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
7839b237
Commit
7839b237
authored
Aug 07, 2017
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logging and promise creation in libcaf_opencl
parent
df9971c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
37 deletions
+43
-37
libcaf_opencl/caf/opencl/actor_facade.hpp
libcaf_opencl/caf/opencl/actor_facade.hpp
+2
-2
libcaf_opencl/caf/opencl/command.hpp
libcaf_opencl/caf/opencl/command.hpp
+2
-4
libcaf_opencl/caf/opencl/opencl_err.hpp
libcaf_opencl/caf/opencl/opencl_err.hpp
+8
-0
libcaf_opencl/src/global.cpp
libcaf_opencl/src/global.cpp
+31
-31
No files found.
libcaf_opencl/caf/opencl/actor_facade.hpp
View file @
7839b237
...
...
@@ -166,10 +166,10 @@ public:
cmd
->
enqueue
();
}
void
enqueue
(
mailbox_element_ptr
ptr
,
execution_unit
*
eu
)
override
{
void
enqueue
(
mailbox_element_ptr
ptr
,
execution_unit
*
)
override
{
CAF_ASSERT
(
ptr
!=
nullptr
);
CAF_LOG_TRACE
(
CAF_ARG
(
*
ptr
));
response_promise
promise
{
eu
,
ctrl
(),
*
ptr
};
response_promise
promise
{
ctrl
(),
*
ptr
};
enqueue
(
ptr
->
sender
,
ptr
->
mid
,
ptr
->
move_content_to_message
(),
std
::
move
(
promise
));
}
...
...
libcaf_opencl/caf/opencl/command.hpp
View file @
7839b237
...
...
@@ -140,8 +140,7 @@ public:
if
(
!
invoke_cl
(
clSetEventCallback
,
callback_
.
get
(),
CL_COMPLETE
,
std
::
move
(
cb
),
this
))
return
;
if
(
clFlush
(
parent
->
queue_
.
get
())
!=
CL_SUCCESS
)
CAF_LOG_ERROR
(
"clFlush: "
<<
CAF_ARG
(
get_opencl_error
(
err
)));
v3callcl
(
clFlush
,
parent
->
queue_
.
get
());
}
/// Enqueue the kernel for execution and send the mem_refs relating to the
...
...
@@ -180,8 +179,7 @@ public:
if
(
!
invoke_cl
(
clSetEventCallback
,
callback_
.
get
(),
CL_COMPLETE
,
std
::
move
(
cb
),
this
))
return
;
if
(
clFlush
(
parent
->
queue_
.
get
())
!=
CL_SUCCESS
)
CAF_LOG_ERROR
(
"clFlush: "
<<
CAF_ARG
(
get_opencl_error
(
err
)));
v3callcl
(
clFlush
,
parent
->
queue_
.
get
());
auto
msg
=
msg_adding_event
{
callback_
}(
results_
);
promise_
.
deliver
(
std
::
move
(
msg
));
}
...
...
libcaf_opencl/caf/opencl/opencl_err.hpp
View file @
7839b237
...
...
@@ -46,6 +46,14 @@ void v2callcl(const char* fname, F f, Ts&&... vs) {
throwcl
(
fname
,
f
(
std
::
forward
<
Ts
>
(
vs
)...,
nullptr
));
}
// call convention for simply calling a function, and logging errors
template
<
class
F
,
class
...
Ts
>
void
v3callcl
(
F
f
,
Ts
&&
...
vs
)
{
auto
err
=
f
(
std
::
forward
<
Ts
>
(
vs
)...);
if
(
err
!=
CL_SUCCESS
)
CAF_LOG_ERROR
(
"error: "
<<
opencl_error
(
err
));
}
// call convention with `result` argument at the end returning `err`, not
// using the second last argument (set to nullptr) nor the one before (set to 0)
template
<
class
R
,
class
F
,
class
...
Ts
>
...
...
libcaf_opencl/src/global.cpp
View file @
7839b237
...
...
@@ -189,50 +189,50 @@ std::string event_status(cl_event e) {
return
ss
.
str
();
}
switch
(
s
)
{
case
(
CL_QUEUED
):
ss
<<
std
::
string
(
"CL_QUEUED"
);
case
(
CL_QUEUED
):
ss
<<
std
::
string
(
"CL_QUEUED"
);
break
;
case
(
CL_SUBMITTED
):
ss
<<
std
::
string
(
"CL_SUBMITTED"
);
case
(
CL_SUBMITTED
):
ss
<<
std
::
string
(
"CL_SUBMITTED"
);
break
;
case
(
CL_RUNNING
):
ss
<<
std
::
string
(
"CL_RUNNING"
);
case
(
CL_RUNNING
):
ss
<<
std
::
string
(
"CL_RUNNING"
);
break
;
case
(
CL_COMPLETE
):
ss
<<
std
::
string
(
"CL_COMPLETE"
);
case
(
CL_COMPLETE
):
ss
<<
std
::
string
(
"CL_COMPLETE"
);
break
;
default:
default:
ss
<<
std
::
string
(
"DEFAULT "
)
+
std
::
to_string
(
s
);
return
ss
.
str
();
}
ss
<<
" / "
;
switch
(
t
)
{
case
(
CL_COMMAND_NDRANGE_KERNEL
):
ss
<<
std
::
string
(
"CL_COMMAND_NDRANGE_KERNEL"
);
ss
<<
std
::
string
(
"CL_COMMAND_NDRANGE_KERNEL"
);
break
;
case
(
CL_COMMAND_TASK
):
ss
<<
std
::
string
(
"CL_COMMAND_TASK"
);
ss
<<
std
::
string
(
"CL_COMMAND_TASK"
);
break
;
case
(
CL_COMMAND_NATIVE_KERNEL
):
ss
<<
std
::
string
(
"CL_COMMAND_NATIVE_KERNEL"
);
ss
<<
std
::
string
(
"CL_COMMAND_NATIVE_KERNEL"
);
break
;
case
(
CL_COMMAND_READ_BUFFER
):
ss
<<
std
::
string
(
"CL_COMMAND_READ_BUFFER"
);
ss
<<
std
::
string
(
"CL_COMMAND_READ_BUFFER"
);
break
;
case
(
CL_COMMAND_WRITE_BUFFER
):
ss
<<
std
::
string
(
"CL_COMMAND_WRITE_BUFFER"
);
ss
<<
std
::
string
(
"CL_COMMAND_WRITE_BUFFER"
);
break
;
case
(
CL_COMMAND_COPY_BUFFER
):
ss
<<
std
::
string
(
"CL_COMMAND_COPY_BUFFER"
);
ss
<<
std
::
string
(
"CL_COMMAND_COPY_BUFFER"
);
break
;
case
(
CL_COMMAND_READ_IMAGE
):
ss
<<
std
::
string
(
"CL_COMMAND_READ_IMAGE"
);
ss
<<
std
::
string
(
"CL_COMMAND_READ_IMAGE"
);
break
;
case
(
CL_COMMAND_WRITE_IMAGE
):
ss
<<
std
::
string
(
"CL_COMMAND_WRITE_IMAGE"
);
ss
<<
std
::
string
(
"CL_COMMAND_WRITE_IMAGE"
);
break
;
case
(
CL_COMMAND_COPY_IMAGE
):
ss
<<
std
::
string
(
"CL_COMMAND_COPY_IMAGE"
);
ss
<<
std
::
string
(
"CL_COMMAND_COPY_IMAGE"
);
break
;
case
(
CL_COMMAND_COPY_BUFFER_TO_IMAGE
):
ss
<<
std
::
string
(
"CL_COMMAND_COPY_BUFFER_TO_IMAGE"
);
...
...
@@ -241,46 +241,46 @@ std::string event_status(cl_event e) {
ss
<<
std
::
string
(
"CL_COMMAND_COPY_IMAGE_TO_BUFFER"
);
break
;
case
(
CL_COMMAND_MAP_BUFFER
):
ss
<<
std
::
string
(
"CL_COMMAND_MAP_BUFFER"
);
ss
<<
std
::
string
(
"CL_COMMAND_MAP_BUFFER"
);
break
;
case
(
CL_COMMAND_MAP_IMAGE
):
ss
<<
std
::
string
(
"CL_COMMAND_MAP_IMAGE"
);
ss
<<
std
::
string
(
"CL_COMMAND_MAP_IMAGE"
);
break
;
case
(
CL_COMMAND_UNMAP_MEM_OBJECT
):
ss
<<
std
::
string
(
"CL_COMMAND_UNMAP_MEM_OBJECT"
);
ss
<<
std
::
string
(
"CL_COMMAND_UNMAP_MEM_OBJECT"
);
break
;
case
(
CL_COMMAND_MARKER
):
ss
<<
std
::
string
(
"CL_COMMAND_MARKER"
);
ss
<<
std
::
string
(
"CL_COMMAND_MARKER"
);
break
;
case
(
CL_COMMAND_ACQUIRE_GL_OBJECTS
):
ss
<<
std
::
string
(
"CL_COMMAND_ACQUIRE_GL_OBJECTS"
);
ss
<<
std
::
string
(
"CL_COMMAND_ACQUIRE_GL_OBJECTS"
);
break
;
case
(
CL_COMMAND_RELEASE_GL_OBJECTS
):
ss
<<
std
::
string
(
"CL_COMMAND_RELEASE_GL_OBJECTS"
);
ss
<<
std
::
string
(
"CL_COMMAND_RELEASE_GL_OBJECTS"
);
break
;
case
(
CL_COMMAND_READ_BUFFER_RECT
):
ss
<<
std
::
string
(
"CL_COMMAND_READ_BUFFER_RECT"
);
ss
<<
std
::
string
(
"CL_COMMAND_READ_BUFFER_RECT"
);
break
;
case
(
CL_COMMAND_WRITE_BUFFER_RECT
):
ss
<<
std
::
string
(
"CL_COMMAND_WRITE_BUFFER_RECT"
);
ss
<<
std
::
string
(
"CL_COMMAND_WRITE_BUFFER_RECT"
);
break
;
case
(
CL_COMMAND_COPY_BUFFER_RECT
):
ss
<<
std
::
string
(
"CL_COMMAND_COPY_BUFFER_RECT"
);
ss
<<
std
::
string
(
"CL_COMMAND_COPY_BUFFER_RECT"
);
break
;
case
(
CL_COMMAND_USER
):
ss
<<
std
::
string
(
"CL_COMMAND_USER"
);
ss
<<
std
::
string
(
"CL_COMMAND_USER"
);
break
;
case
(
CL_COMMAND_BARRIER
):
ss
<<
std
::
string
(
"CL_COMMAND_BARRIER"
);
ss
<<
std
::
string
(
"CL_COMMAND_BARRIER"
);
break
;
case
(
CL_COMMAND_MIGRATE_MEM_OBJECTS
):
ss
<<
std
::
string
(
"CL_COMMAND_MIGRATE_MEM_OBJECTS"
);
break
;
case
(
CL_COMMAND_FILL_BUFFER
):
ss
<<
std
::
string
(
"CL_COMMAND_FILL_BUFFER"
);
ss
<<
std
::
string
(
"CL_COMMAND_FILL_BUFFER"
);
break
;
case
(
CL_COMMAND_FILL_IMAGE
):
ss
<<
std
::
string
(
"CL_COMMAND_FILL_IMAGE"
);
ss
<<
std
::
string
(
"CL_COMMAND_FILL_IMAGE"
);
break
;
default:
ss
<<
std
::
string
(
"DEFAULT "
)
+
std
::
to_string
(
s
);
...
...
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