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
f0da4da7
Commit
f0da4da7
authored
May 06, 2013
by
Joseph Noir
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'unstable' of github.com:Neverlord/libcppa into unstable
Conflicts: src/opencl/command_dispatcher.cpp
parents
a86e5945
2bced238
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
+25
-25
libcaf_opencl/cppa/opencl/actor_facade.hpp
libcaf_opencl/cppa/opencl/actor_facade.hpp
+6
-6
libcaf_opencl/src/opencl/command_dispatcher.cpp
libcaf_opencl/src/opencl/command_dispatcher.cpp
+15
-15
libcaf_opencl/src/opencl/program.cpp
libcaf_opencl/src/opencl/program.cpp
+4
-4
No files found.
libcaf_opencl/cppa/opencl/actor_facade.hpp
View file @
f0da4da7
...
...
@@ -82,7 +82,7 @@ class actor_facade<Ret(Args...)> : public actor {
result_mapping
map_result
)
{
if
(
global_dims
.
empty
())
{
auto
str
=
"OpenCL kernel needs at least 1 global dimension."
;
CPPA_LOGM_ERROR
(
detail
::
demangle
(
typeid
(
actor_facade
)),
str
);
CPPA_LOGM_ERROR
(
detail
::
demangle
(
typeid
(
actor_facade
))
.
c_str
()
,
str
);
throw
std
::
runtime_error
(
str
);
}
auto
check_vec
=
[
&
](
const
dim_vec
&
vec
,
const
char
*
name
)
{
...
...
@@ -90,7 +90,7 @@ class actor_facade<Ret(Args...)> : public actor {
std
::
ostringstream
oss
;
oss
<<
name
<<
" vector is not empty, but "
<<
"its size differs from global dimensions vector's size"
;
CPPA_LOGM_ERROR
(
detail
::
demangle
<
actor_facade
>
(),
oss
.
str
());
CPPA_LOGM_ERROR
(
detail
::
demangle
<
actor_facade
>
()
.
c_str
()
,
oss
.
str
());
throw
std
::
runtime_error
(
oss
.
str
());
}
};
...
...
@@ -104,7 +104,7 @@ class actor_facade<Ret(Args...)> : public actor {
if
(
err
!=
CL_SUCCESS
)
{
std
::
ostringstream
oss
;
oss
<<
"clCreateKernel: "
<<
get_opencl_error
(
err
);
CPPA_LOGM_ERROR
(
detail
::
demangle
<
actor_facade
>
(),
oss
.
str
());
CPPA_LOGM_ERROR
(
detail
::
demangle
<
actor_facade
>
()
.
c_str
()
,
oss
.
str
());
throw
std
::
runtime_error
(
oss
.
str
());
}
return
new
actor_facade
<
Ret
(
Args
...)
>
{
dispatcher
,
...
...
@@ -169,7 +169,7 @@ class actor_facade<Ret(Args...)> : public actor {
m_local_dimensions
,
m_map_result
));
}
else
{
CPPA_LOG
_ERROR
(
"actor_facade::enqueue() tuple_cast failed."
);
}
else
{
CPPA_LOG
MF
(
CPPA_ERROR
,
this
,
"actor_facade::enqueue() tuple_cast failed."
);
}
}
typedef
std
::
vector
<
mem_ptr
>
args_vec
;
...
...
@@ -217,7 +217,7 @@ class actor_facade<Ret(Args...)> : public actor {
arg0
.
data
(),
&
err
);
if
(
err
!=
CL_SUCCESS
)
{
CPPA_LOG
_ERROR
(
"clCreateBuffer: "
<<
get_opencl_error
(
err
));
CPPA_LOG
MF
(
CPPA_ERROR
,
this
,
"clCreateBuffer: "
<<
get_opencl_error
(
err
));
}
else
{
mem_ptr
tmp
;
...
...
@@ -241,7 +241,7 @@ class actor_facade<Ret(Args...)> : public actor {
nullptr
,
&
err
);
if
(
err
!=
CL_SUCCESS
)
{
CPPA_LOG
_ERROR
(
"clCreateBuffer: "
<<
get_opencl_error
(
err
));
CPPA_LOG
MF
(
CPPA_ERROR
,
this
,
"clCreateBuffer: "
<<
get_opencl_error
(
err
));
}
else
{
mem_ptr
tmp
;
...
...
libcaf_opencl/src/opencl/command_dispatcher.cpp
View file @
f0da4da7
...
...
@@ -80,14 +80,14 @@ struct command_dispatcher::worker {
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
oss
<<
"clFlush: "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
}
catch
(
exception
&
e
)
{
ostringstream
oss
;
oss
<<
"worker loop, e.what(): "
<<
e
.
what
();
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
}
...
...
@@ -107,12 +107,12 @@ void command_dispatcher::worker_loop(command_dispatcher::worker* w) {
void
command_dispatcher
::
supervisor_loop
(
command_dispatcher
*
scheduler
,
job_queue
*
jq
,
command_ptr
m_dummy
)
{
CPPA_LOGF_TRACE
(
""
);
unique_ptr
<
command_dispatcher
::
worker
>
worker
;
worker
.
reset
(
new
command_dispatcher
::
worker
(
scheduler
,
jq
,
m_dummy
));
worker
->
start
();
worker
->
m_thread
.
join
();
worker
.
reset
();
CPPA_LOG_TRACE
(
"supervisor done"
);
}
void
command_dispatcher
::
initialize
()
{
...
...
@@ -128,13 +128,13 @@ void command_dispatcher::initialize() {
ostringstream
oss
;
oss
<<
"clGetPlatformIDs (getting number of platforms): "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
logic_error
(
oss
.
str
());
}
else
if
(
number_of_platforms
<
1
)
{
ostringstream
oss
;
oss
<<
"clGetPlatformIDs: no platforms found."
;
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
logic_error
(
oss
.
str
());
}
...
...
@@ -144,7 +144,7 @@ void command_dispatcher::initialize() {
ostringstream
oss
;
oss
<<
"clGetPlatformIDs (getting platform ids): "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
logic_error
(
oss
.
str
());
}
...
...
@@ -162,7 +162,7 @@ void command_dispatcher::initialize() {
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
oss
<<
"clGetDeviceIDs: "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
vector
<
cl_device_id
>
devices
(
num_devices
);
...
...
@@ -170,7 +170,7 @@ void command_dispatcher::initialize() {
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
oss
<<
"clGetDeviceIDs: "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
...
...
@@ -179,7 +179,7 @@ void command_dispatcher::initialize() {
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
oss
<<
"clCreateContext: "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
...
...
@@ -193,7 +193,7 @@ void command_dispatcher::initialize() {
char
buf
[
buf_size
];
err
=
clGetDeviceInfo
(
device
.
get
(),
CL_DEVICE_NAME
,
buf_size
,
buf
,
&
return_size
);
if
(
err
!=
CL_SUCCESS
)
{
CPPA_LOG
_ERROR
(
"clGetDeviceInfo (CL_DEVICE_NAME): "
<<
get_opencl_error
(
err
));
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
"clGetDeviceInfo (CL_DEVICE_NAME): "
<<
get_opencl_error
(
err
));
fill
(
buf
,
buf
+
buf_size
,
0
);
}
command_queue_ptr
cmd_queue
;
...
...
@@ -202,7 +202,7 @@ void command_dispatcher::initialize() {
CL_QUEUE_PROFILING_ENABLE
,
&
err
));
if
(
err
!=
CL_SUCCESS
)
{
CPPA_LOG
_DEBUG
(
"Could not create command queue for device "
CPPA_LOG
MF
(
CPPA_DEBUG
,
self
,
"Could not create command queue for device "
<<
buf
<<
": "
<<
get_opencl_error
(
err
));
}
else
{
...
...
@@ -217,7 +217,7 @@ void command_dispatcher::initialize() {
oss
<<
"clGetDeviceInfo ("
<<
id
<<
":CL_DEVICE_MAX_WORK_GROUP_SIZE): "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
cl_uint
max_work_item_dimensions
=
0
;
...
...
@@ -231,7 +231,7 @@ void command_dispatcher::initialize() {
oss
<<
"clGetDeviceInfo ("
<<
id
<<
":CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS): "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
dim_vec
max_work_items_per_dim
(
max_work_item_dimensions
);
...
...
@@ -245,7 +245,7 @@ void command_dispatcher::initialize() {
oss
<<
"clGetDeviceInfo ("
<<
id
<<
":CL_DEVICE_MAX_WORK_ITEM_SIZES): "
<<
get_opencl_error
(
err
);
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
device_info
dev_info
{
id
,
...
...
@@ -261,7 +261,7 @@ void command_dispatcher::initialize() {
ostringstream
oss
;
oss
<<
"Could not create a command queue for "
<<
"any of the present devices."
;
CPPA_LOG
_ERROR
(
oss
.
str
());
CPPA_LOG
MF
(
CPPA_ERROR
,
self
,
oss
.
str
());
throw
runtime_error
(
oss
.
str
());
}
else
{
...
...
libcaf_opencl/src/opencl/program.cpp
View file @
f0da4da7
...
...
@@ -89,11 +89,11 @@ program program::create(const char* kernel_source) {
std
::
ostringstream
oss
;
oss
<<
"clBuildProgram: "
<<
get_opencl_error
(
err
)
<<
", build log: "
<<
build_log
.
data
();
CPPA_LOGM_ERROR
(
detail
::
demangle
<
program
>
(),
oss
.
str
());
CPPA_LOGM_ERROR
(
detail
::
demangle
<
program
>
()
.
c_str
()
,
oss
.
str
());
throw
std
::
runtime_error
(
oss
.
str
());
}
else
{
# ifdef CPPA_DEBUG
# ifdef CPPA_DEBUG
_MODE
device_ptr
device_used
(
cppa
::
detail
::
singleton_manager
::
get_command_dispatcher
()
->
m_devices
.
front
().
dev_id
);
...
...
@@ -119,8 +119,8 @@ program program::create(const char* kernel_source) {
build_log
.
data
(),
nullptr
);
build_log
[
ret_val_size
]
=
'\0'
;
CPPA_LOG
_DEBUG
(
"clBuildProgram build log: "
<<
build_log
.
data
());
CPPA_LOG
M_DEBUG
(
"program"
,
"clBuildProgram build log: "
<<
build_log
.
data
());
# endif
}
return
{
cptr
,
pptr
};
...
...
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