Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
e1ffb3bf
Commit
e1ffb3bf
authored
May 06, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'unstable' of github.com:Neverlord/libcppa into unstable
parents
73bc4883
65431a50
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
17 deletions
+27
-17
cppa/option.hpp
cppa/option.hpp
+1
-1
examples/opencl/proper_matrix.cpp
examples/opencl/proper_matrix.cpp
+7
-7
src/opencl/command_dispatcher.cpp
src/opencl/command_dispatcher.cpp
+14
-4
unit_testing/test_opencl.cpp
unit_testing/test_opencl.cpp
+5
-5
No files found.
cppa/option.hpp
View file @
e1ffb3bf
...
@@ -63,7 +63,7 @@ class option {
...
@@ -63,7 +63,7 @@ class option {
option
(
T
value
)
:
m_valid
(
false
)
{
cr
(
std
::
move
(
value
));
}
option
(
T
value
)
:
m_valid
(
false
)
{
cr
(
std
::
move
(
value
));
}
template
<
typename
T0
,
typename
T1
,
typename
...
Ts
>
template
<
typename
T0
,
typename
T1
,
typename
...
Ts
>
option
(
T0
&&
arg0
,
T1
&&
arg1
,
Ts
&&
...
args
)
{
option
(
T0
&&
arg0
,
T1
&&
arg1
,
Ts
&&
...
args
)
:
m_valid
(
false
)
{
cr
(
T
(
std
::
forward
<
T0
>
(
arg0
),
cr
(
T
(
std
::
forward
<
T0
>
(
arg0
),
std
::
forward
<
T1
>
(
arg1
),
std
::
forward
<
T1
>
(
arg1
),
std
::
forward
<
Ts
>
(
args
)...));
std
::
forward
<
Ts
>
(
args
)...));
...
...
examples/opencl/proper_matrix.cpp
View file @
e1ffb3bf
...
@@ -86,12 +86,12 @@ class square_matrix {
...
@@ -86,12 +86,12 @@ class square_matrix {
}
}
inline
float
&
operator
()(
size_t
row
,
size_t
column
)
{
inline
float
&
operator
()(
size_t
column
,
size_t
row
)
{
return
m_data
[
row
+
column
*
Size
];
return
m_data
[
column
+
row
*
Size
];
}
}
inline
const
float
&
operator
()(
size_t
row
,
size_t
column
)
const
{
inline
const
float
&
operator
()(
size_t
column
,
size_t
row
)
const
{
return
m_data
[
row
+
column
*
Size
];
return
m_data
[
column
+
row
*
Size
];
}
}
inline
void
iota_fill
()
{
inline
void
iota_fill
()
{
...
@@ -118,9 +118,9 @@ template<size_t Size>
...
@@ -118,9 +118,9 @@ template<size_t Size>
string
to_string
(
const
square_matrix
<
Size
>&
m
)
{
string
to_string
(
const
square_matrix
<
Size
>&
m
)
{
ostringstream
oss
;
ostringstream
oss
;
oss
.
fill
(
' '
);
oss
.
fill
(
' '
);
for
(
size_t
column
=
0
;
column
<
Size
;
++
column
)
{
for
(
size_t
row
=
0
;
row
<
Size
;
++
row
)
{
for
(
size_t
row
=
0
;
row
<
Size
;
++
row
)
{
for
(
size_t
column
=
0
;
column
<
Size
;
++
column
)
{
oss
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
9
)
<<
m
(
row
,
column
);
oss
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
9
)
<<
m
(
column
,
row
);
}
}
oss
<<
'\n'
;
oss
<<
'\n'
;
}
}
...
...
src/opencl/command_dispatcher.cpp
View file @
e1ffb3bf
...
@@ -122,18 +122,28 @@ void command_dispatcher::initialize() {
...
@@ -122,18 +122,28 @@ void command_dispatcher::initialize() {
cl_int
err
{
0
};
cl_int
err
{
0
};
/* find up to two available platforms */
/* find up to two available platforms */
vector
<
cl_platform_id
>
ids
(
2
);
cl_uint
number_of_platforms
;
cl_uint
number_of_platforms
;
err
=
clGetPlatformIDs
(
ids
.
size
(),
ids
.
data
()
,
&
number_of_platforms
);
err
=
clGetPlatformIDs
(
0
,
nullptr
,
&
number_of_platforms
);
if
(
err
!=
CL_SUCCESS
)
{
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
ostringstream
oss
;
oss
<<
"clGetPlatformIDs: "
<<
get_opencl_error
(
err
);
oss
<<
"clGetPlatformIDs (getting number of platforms): "
<<
get_opencl_error
(
err
);
CPPA_LOGMF
(
CPPA_ERROR
,
self
,
oss
.
str
());
CPPA_LOGMF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
logic_error
(
oss
.
str
());
throw
logic_error
(
oss
.
str
());
}
}
else
if
(
number_of_platforms
<
1
)
{
else
if
(
number_of_platforms
<
1
)
{
ostringstream
oss
;
ostringstream
oss
;
oss
<<
"clGetPlatformIDs: 'no platforms found'."
;
oss
<<
"clGetPlatformIDs: no platforms found."
;
CPPA_LOGMF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
logic_error
(
oss
.
str
());
}
vector
<
cl_platform_id
>
ids
(
number_of_platforms
);
err
=
clGetPlatformIDs
(
ids
.
size
(),
ids
.
data
(),
nullptr
);
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
oss
<<
"clGetPlatformIDs (getting platform ids): "
<<
get_opencl_error
(
err
);
CPPA_LOGMF
(
CPPA_ERROR
,
self
,
oss
.
str
());
CPPA_LOGMF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
logic_error
(
oss
.
str
());
throw
logic_error
(
oss
.
str
());
}
}
...
...
unit_testing/test_opencl.cpp
View file @
e1ffb3bf
...
@@ -30,7 +30,7 @@ constexpr const char* kernel_source = R"__(
...
@@ -30,7 +30,7 @@ constexpr const char* kernel_source = R"__(
for (size_t idx = 0; idx < size; ++idx) {
for (size_t idx = 0; idx < size; ++idx) {
result += matrix[idx + y * size] * matrix[x + idx * size];
result += matrix[idx + y * size] * matrix[x + idx * size];
}
}
output[x
+y*
size] = result;
output[x
+ y *
size] = result;
}
}
)__"
;
)__"
;
...
@@ -54,12 +54,12 @@ class square_matrix {
...
@@ -54,12 +54,12 @@ class square_matrix {
assert
(
m_data
.
size
()
==
num_elements
);
assert
(
m_data
.
size
()
==
num_elements
);
}
}
inline
float
&
operator
()(
size_t
row
,
size_t
column
)
{
inline
float
&
operator
()(
size_t
column
,
size_t
row
)
{
return
m_data
[
row
+
column
*
Size
];
return
m_data
[
column
+
row
*
Size
];
}
}
inline
const
float
&
operator
()(
size_t
row
,
size_t
column
)
const
{
inline
const
float
&
operator
()(
size_t
column
,
size_t
row
)
const
{
return
m_data
[
row
+
column
*
Size
];
return
m_data
[
column
+
row
*
Size
];
}
}
inline
void
iota_fill
()
{
inline
void
iota_fill
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment