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
9ce2a1cf
Commit
9ce2a1cf
authored
Jan 30, 2014
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved readability of add_arguments_to_kernel
rotate buffer, instead of multiple function calls
parent
8c5c49dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
libcaf_opencl/cppa/opencl/actor_facade.hpp
libcaf_opencl/cppa/opencl/actor_facade.hpp
+5
-9
libcaf_opencl/cppa/opencl/command.hpp
libcaf_opencl/cppa/opencl/command.hpp
+1
-1
No files found.
libcaf_opencl/cppa/opencl/actor_facade.hpp
View file @
9ce2a1cf
...
@@ -33,9 +33,9 @@
...
@@ -33,9 +33,9 @@
#define CPPA_OPENCL_ACTOR_FACADE_HPP
#define CPPA_OPENCL_ACTOR_FACADE_HPP
#include <ostream>
#include <ostream>
#include <iostream>
#include <algorithm>
#include <algorithm>
#include <stdexcept>
#include <stdexcept>
#include <iostream>
#include "cppa/cppa.hpp"
#include "cppa/cppa.hpp"
...
@@ -190,20 +190,16 @@ class actor_facade<Ret(Args...)> : public actor {
...
@@ -190,20 +190,16 @@ class actor_facade<Ret(Args...)> : public actor {
void
add_arguments_to_kernel_rec
(
args_vec
&
arguments
)
{
void
add_arguments_to_kernel_rec
(
args_vec
&
arguments
)
{
cl_int
err
{
0
};
cl_int
err
{
0
};
for
(
size_t
i
=
1
;
i
<
arguments
.
size
();
++
i
)
{
// rotate left (output buffer to the end)
rotate
(
begin
(
arguments
),
begin
(
arguments
)
+
1
,
end
(
arguments
));
for
(
size_t
i
=
0
;
i
<
arguments
.
size
();
++
i
)
{
err
=
clSetKernelArg
(
m_kernel
.
get
(),
err
=
clSetKernelArg
(
m_kernel
.
get
(),
(
i
-
1
)
,
i
,
sizeof
(
cl_mem
),
sizeof
(
cl_mem
),
static_cast
<
void
*>
(
&
arguments
[
i
]));
static_cast
<
void
*>
(
&
arguments
[
i
]));
CPPA_LOG_ERROR_IF
(
err
!=
CL_SUCCESS
,
CPPA_LOG_ERROR_IF
(
err
!=
CL_SUCCESS
,
"clSetKernelArg: "
<<
get_opencl_error
(
err
));
"clSetKernelArg: "
<<
get_opencl_error
(
err
));
}
}
err
=
clSetKernelArg
(
m_kernel
.
get
(),
arguments
.
size
()
-
1
,
sizeof
(
cl_mem
),
static_cast
<
void
*>
(
&
arguments
[
0
]));
CPPA_LOG_ERROR_IF
(
err
!=
CL_SUCCESS
,
"clSetKernelArg: "
<<
get_opencl_error
(
err
));
}
}
template
<
typename
T0
,
typename
...
Ts
>
template
<
typename
T0
,
typename
...
Ts
>
...
...
libcaf_opencl/cppa/opencl/command.hpp
View file @
9ce2a1cf
...
@@ -88,7 +88,7 @@ class command : public ref_counted {
...
@@ -88,7 +88,7 @@ class command : public ref_counted {
else
{
else
{
auto
event_r
=
m_read_event
.
get
();
auto
event_r
=
m_read_event
.
get
();
err
=
clEnqueueReadBuffer
(
m_queue
.
get
(),
err
=
clEnqueueReadBuffer
(
m_queue
.
get
(),
m_arguments
[
0
]
.
get
(),
m_arguments
.
back
()
.
get
(),
CL_FALSE
,
CL_FALSE
,
0
,
0
,
sizeof
(
typename
R
::
value_type
)
*
m_result_size
,
sizeof
(
typename
R
::
value_type
)
*
m_result_size
,
...
...
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