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
a31c0fc8
Commit
a31c0fc8
authored
Jan 05, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply clang-tidy to codebase
parent
219313d1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
41 deletions
+44
-41
libcaf_opencl/caf/opencl/actor_facade.hpp
libcaf_opencl/caf/opencl/actor_facade.hpp
+10
-11
libcaf_opencl/caf/opencl/arguments.hpp
libcaf_opencl/caf/opencl/arguments.hpp
+1
-1
libcaf_opencl/caf/opencl/command.hpp
libcaf_opencl/caf/opencl/command.hpp
+7
-7
libcaf_opencl/caf/opencl/device.hpp
libcaf_opencl/caf/opencl/device.hpp
+11
-3
libcaf_opencl/caf/opencl/manager.hpp
libcaf_opencl/caf/opencl/manager.hpp
+2
-2
libcaf_opencl/examples/proper_matrix.cpp
libcaf_opencl/examples/proper_matrix.cpp
+1
-1
libcaf_opencl/src/device.cpp
libcaf_opencl/src/device.cpp
+9
-14
libcaf_opencl/src/platform.cpp
libcaf_opencl/src/platform.cpp
+2
-1
libcaf_opencl/test/opencl.cpp
libcaf_opencl/test/opencl.cpp
+1
-1
No files found.
libcaf_opencl/caf/opencl/actor_facade.hpp
View file @
a31c0fc8
...
...
@@ -127,7 +127,7 @@ public:
std
::
move
(
map_args
),
std
::
move
(
map_result
),
std
::
forward_as_tuple
(
xs
...));
}
else
{
}
return
make_actor
<
actor_facade
,
actor
>
(
sys
.
next_actor_id
(),
sys
.
node
(),
&
sys
,
std
::
move
(
actor_cfg
),
prog
,
itr
->
second
,
spawn_cfg
,
...
...
@@ -135,7 +135,6 @@ public:
std
::
move
(
map_result
),
std
::
forward_as_tuple
(
xs
...));
}
}
void
enqueue
(
strong_actor_ptr
sender
,
message_id
mid
,
message
content
,
execution_unit
*
)
override
{
...
...
@@ -176,18 +175,18 @@ public:
actor_facade
(
actor_config
actor_cfg
,
const
program
&
prog
,
kernel_ptr
kernel
,
const
spawn_config
&
spawn_cfg
,
spawn_config
spawn_cfg
,
input_mapping
map_args
,
output_mapping
map_result
,
std
::
tuple
<
Ts
...
>
xs
)
:
monitorable_actor
(
actor_cfg
),
kernel_
(
kernel
),
kernel_
(
std
::
move
(
kernel
)
),
program_
(
prog
.
program_
),
context_
(
prog
.
context_
),
queue_
(
prog
.
queue_
),
spawn_cfg_
(
s
pawn_cfg
),
spawn_cfg_
(
s
td
::
move
(
spawn_cfg
)
),
map_args_
(
std
::
move
(
map_args
)),
map_results_
(
std
::
move
(
map_result
)),
argument_types_
(
xs
)
{
argument_types_
(
std
::
move
(
xs
)
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
this
->
id
()));
default_output_size_
=
std
::
accumulate
(
spawn_cfg_
.
dimensions
().
begin
(),
spawn_cfg_
.
dimensions
().
end
(),
...
...
libcaf_opencl/caf/opencl/arguments.hpp
View file @
a31c0fc8
...
...
@@ -53,7 +53,7 @@ struct in_out {
template
<
class
Arg
>
struct
out
{
out
()
{
}
out
()
=
default
;
template
<
class
F
>
out
(
F
fun
)
{
fun_
=
[
fun
](
message
&
msg
)
->
optional
<
size_t
>
{
...
...
libcaf_opencl/caf/opencl/command.hpp
View file @
a31c0fc8
...
...
@@ -49,17 +49,17 @@ public:
std
::
vector
<
cl_event
>
events
,
std
::
vector
<
mem_ptr
>
input_buffers
,
std
::
vector
<
mem_ptr
>
output_buffers
,
std
::
vector
<
size_t
>
result_sizes
,
message
msg
)
:
result_sizes_
(
result_sizes
),
handle_
(
handle
),
actor_facade_
(
actor_facade
),
:
result_sizes_
(
std
::
move
(
result_sizes
)
),
handle_
(
std
::
move
(
handle
)
),
actor_facade_
(
std
::
move
(
actor_facade
)
),
mem_in_events_
(
std
::
move
(
events
)),
input_buffers_
(
std
::
move
(
input_buffers
)),
output_buffers_
(
std
::
move
(
output_buffers
)),
msg_
(
msg
)
{
msg_
(
std
::
move
(
msg
)
)
{
// nop
}
~
command
()
{
~
command
()
override
{
for
(
auto
&
e
:
mem_in_events_
)
{
v1callcl
(
CAF_CLF
(
clReleaseEvent
),
e
);
}
...
...
@@ -95,7 +95,7 @@ public:
clReleaseEvent
(
event_k
);
this
->
deref
();
return
;
}
else
{
}
enqueue_read_buffers
(
event_k
,
detail
::
get_indices
(
result_buffers_
));
cl_event
marker
;
#if defined(__APPLE__)
...
...
@@ -134,7 +134,7 @@ public:
}
mem_out_events_
.
push_back
(
std
::
move
(
event_k
));
mem_out_events_
.
push_back
(
std
::
move
(
marker
));
}
}
private:
...
...
libcaf_opencl/caf/opencl/device.hpp
View file @
a31c0fc8
...
...
@@ -37,7 +37,8 @@ public:
friend
class
manager
;
/// Intialize a new device in a context using a sepcific device_id
static
device
create
(
context_ptr
context
,
device_ptr
device_id
,
unsigned
id
);
static
device
create
(
const
context_ptr
&
context
,
const
device_ptr
&
device_id
,
unsigned
id
);
/// Get the id assigned by caf
inline
unsigned
get_id
()
const
;
/// Returns device info on CL_DEVICE_ADDRESS_BITS
...
...
@@ -94,9 +95,16 @@ public:
private:
device
(
device_ptr
device_id
,
command_queue_ptr
queue
,
context_ptr
context
,
unsigned
id
);
template
<
class
T
>
static
T
info
(
device_ptr
device_id
,
unsigned
info_flag
);
static
std
::
string
info_string
(
device_ptr
device_id
,
unsigned
info_flag
);
static
T
info
(
const
device_ptr
&
device_id
,
unsigned
info_flag
)
{
T
value
;
clGetDeviceInfo
(
device_id
.
get
(),
info_flag
,
sizeof
(
T
),
&
value
,
nullptr
);
return
value
;
}
static
std
::
string
info_string
(
const
device_ptr
&
device_id
,
unsigned
info_flag
);
device_ptr
device_id_
;
command_queue_ptr
command_queue_
;
context_ptr
context_
;
...
...
libcaf_opencl/caf/opencl/manager.hpp
View file @
a31c0fc8
...
...
@@ -49,7 +49,7 @@ public:
manager
(
const
manager
&
)
=
delete
;
manager
&
operator
=
(
const
manager
&
)
=
delete
;
/// Get the device with id, which is assigned sequientally.
const
optional
<
const
device
&>
get_device
(
size_t
id
=
0
)
const
;
const
optional
<
const
device
&>
get_device
(
size_t
dev_
id
=
0
)
const
;
/// Get the first device that satisfies the predicate.
/// The predicate should accept a `const device&` and return a bool;
template
<
class
UnaryPredicate
>
...
...
@@ -166,7 +166,7 @@ public:
protected:
manager
(
actor_system
&
sys
);
~
manager
();
~
manager
()
override
;
private:
actor_system
&
system_
;
...
...
libcaf_opencl/examples/proper_matrix.cpp
View file @
a31c0fc8
...
...
@@ -98,7 +98,7 @@ public:
iota
(
data_
.
begin
(),
data_
.
end
(),
0
);
}
typedef
typename
fvec
::
const_iterator
const_iterator
;
using
const_iterator
=
typename
fvec
::
const_iterator
;
const_iterator
begin
()
const
{
return
data_
.
begin
();
}
...
...
libcaf_opencl/src/device.cpp
View file @
a31c0fc8
...
...
@@ -18,6 +18,7 @@
******************************************************************************/
#include <iostream>
#include <utility>
#include "caf/logger.hpp"
#include "caf/string_algorithms.hpp"
...
...
@@ -31,12 +32,13 @@ using namespace std;
namespace
caf
{
namespace
opencl
{
device
device
::
create
(
context_ptr
context
,
device_ptr
device_id
,
unsigned
id
)
{
device
device
::
create
(
const
context_ptr
&
context
,
const
device_ptr
&
device_id
,
unsigned
id
)
{
CAF_LOG_DEBUG
(
"creating device for opencl device with id:"
<<
CAF_ARG
(
id
));
// look up properties we need to create the command queue
auto
supported
=
info
<
cl_ulong
>
(
device_id
,
CL_DEVICE_QUEUE_PROPERTIES
);
bool
profiling
=
supported
&
CL_QUEUE_PROFILING_ENABLE
;
bool
out_of_order
=
supported
&
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
;
bool
profiling
=
(
supported
&
CL_QUEUE_PROFILING_ENABLE
)
!=
0u
;
bool
out_of_order
=
(
supported
&
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
)
!=
0u
;
unsigned
properties
=
profiling
?
CL_QUEUE_PROFILING_ENABLE
:
0
;
properties
|=
out_of_order
?
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
:
0
;
// create the command queue
...
...
@@ -94,14 +96,7 @@ device device::create(context_ptr context, device_ptr device_id, unsigned id) {
return
dev
;
}
template
<
class
T
>
T
device
::
info
(
device_ptr
device_id
,
unsigned
info_flag
)
{
T
value
;
clGetDeviceInfo
(
device_id
.
get
(),
info_flag
,
sizeof
(
T
),
&
value
,
nullptr
);
return
value
;
}
string
device
::
info_string
(
device_ptr
device_id
,
unsigned
info_flag
)
{
string
device
::
info_string
(
const
device_ptr
&
device_id
,
unsigned
info_flag
)
{
size_t
size
;
clGetDeviceInfo
(
device_id
.
get
(),
info_flag
,
0
,
nullptr
,
&
size
);
vector
<
char
>
buffer
(
size
);
...
...
@@ -112,9 +107,9 @@ string device::info_string(device_ptr device_id, unsigned info_flag) {
device
::
device
(
device_ptr
device_id
,
command_queue_ptr
queue
,
context_ptr
context
,
unsigned
id
)
:
device_id_
(
device_id
),
command_queue_
(
queue
),
context_
(
context
),
:
device_id_
(
std
::
move
(
device_id
)
),
command_queue_
(
std
::
move
(
queue
)
),
context_
(
std
::
move
(
context
)
),
id_
(
id
)
{
}
}
// namespace opencl
...
...
libcaf_opencl/src/platform.cpp
View file @
a31c0fc8
...
...
@@ -17,6 +17,7 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include <utility>
#include <vector>
#include <iostream>
...
...
@@ -90,7 +91,7 @@ platform::platform(cl_platform_id platform_id, context_ptr context,
string
name
,
string
vendor
,
string
version
,
vector
<
device
>
devices
)
:
platform_id_
(
platform_id
),
context_
(
context
),
context_
(
std
::
move
(
context
)
),
name_
(
move
(
name
)),
vendor_
(
move
(
vendor
)),
version_
(
move
(
version
)),
...
...
libcaf_opencl/test/opencl.cpp
View file @
a31c0fc8
...
...
@@ -140,7 +140,7 @@ public:
return
data_
[
column
+
row
*
Size
];
}
typedef
typename
ivec
::
const_iterator
const_iterator
;
using
const_iterator
=
typename
ivec
::
const_iterator
;
const_iterator
begin
()
const
{
return
data_
.
begin
();
...
...
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