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
b524a6c3
Commit
b524a6c3
authored
Nov 04, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optional => maybe
parent
a6d1df77
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
20 deletions
+20
-20
libcaf_opencl/caf/opencl/actor_facade.hpp
libcaf_opencl/caf/opencl/actor_facade.hpp
+1
-1
libcaf_opencl/caf/opencl/arguments.hpp
libcaf_opencl/caf/opencl/arguments.hpp
+4
-4
libcaf_opencl/caf/opencl/metainfo.hpp
libcaf_opencl/caf/opencl/metainfo.hpp
+3
-3
libcaf_opencl/caf/opencl/spawn_cl.hpp
libcaf_opencl/caf/opencl/spawn_cl.hpp
+8
-8
libcaf_opencl/examples/proper_matrix.cpp
libcaf_opencl/examples/proper_matrix.cpp
+1
-1
libcaf_opencl/src/metainfo.cpp
libcaf_opencl/src/metainfo.cpp
+1
-1
libcaf_opencl/test/opencl.cpp
libcaf_opencl/test/opencl.cpp
+1
-1
libcaf_opencl/test/opencl_deprecated.cpp
libcaf_opencl/test/opencl_deprecated.cpp
+1
-1
No files found.
libcaf_opencl/caf/opencl/actor_facade.hpp
View file @
b524a6c3
...
@@ -74,7 +74,7 @@ public:
...
@@ -74,7 +74,7 @@ public:
typename
detail
::
tl_filter
<
arg_types
,
is_input_arg
>::
type
;
typename
detail
::
tl_filter
<
arg_types
,
is_input_arg
>::
type
;
using
input_types
=
using
input_types
=
typename
detail
::
tl_map
<
input_wrapped_types
,
extract_type
>::
type
;
typename
detail
::
tl_map
<
input_wrapped_types
,
extract_type
>::
type
;
using
input_mapping
=
std
::
function
<
optional
<
message
>
(
message
&
)
>
;
using
input_mapping
=
std
::
function
<
maybe
<
message
>
(
message
&
)
>
;
using
output_wrapped_types
=
using
output_wrapped_types
=
typename
detail
::
tl_filter
<
arg_types
,
is_output_arg
>::
type
;
typename
detail
::
tl_filter
<
arg_types
,
is_output_arg
>::
type
;
...
...
libcaf_opencl/caf/opencl/arguments.hpp
View file @
b524a6c3
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include <type_traits>
#include <type_traits>
#include "caf/message.hpp"
#include "caf/message.hpp"
#include "caf/
optional
.hpp"
#include "caf/
maybe
.hpp"
namespace
caf
{
namespace
caf
{
namespace
opencl
{
namespace
opencl
{
...
@@ -56,7 +56,7 @@ struct out {
...
@@ -56,7 +56,7 @@ struct out {
out
()
{
}
out
()
{
}
template
<
class
F
>
template
<
class
F
>
out
(
F
fun
)
{
out
(
F
fun
)
{
fun_
=
[
fun
](
message
&
msg
)
->
optional
<
size_t
>
{
fun_
=
[
fun
](
message
&
msg
)
->
maybe
<
size_t
>
{
auto
res
=
msg
.
apply
(
fun
);
auto
res
=
msg
.
apply
(
fun
);
size_t
result
;
size_t
result
;
if
(
res
)
{
if
(
res
)
{
...
@@ -66,10 +66,10 @@ struct out {
...
@@ -66,10 +66,10 @@ struct out {
return
none
;
return
none
;
};
};
}
}
optional
<
size_t
>
operator
()(
message
&
msg
)
const
{
maybe
<
size_t
>
operator
()(
message
&
msg
)
const
{
return
fun_
?
fun_
(
msg
)
:
0
;
return
fun_
?
fun_
(
msg
)
:
0
;
}
}
std
::
function
<
optional
<
size_t
>
(
message
&
)
>
fun_
;
std
::
function
<
maybe
<
size_t
>
(
message
&
)
>
fun_
;
};
};
...
...
libcaf_opencl/caf/opencl/metainfo.hpp
View file @
b524a6c3
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include "caf/all.hpp"
#include "caf/all.hpp"
#include "caf/config.hpp"
#include "caf/config.hpp"
#include "caf/
optional
.hpp"
#include "caf/
maybe
.hpp"
#include "caf/opencl/device.hpp"
#include "caf/opencl/device.hpp"
#include "caf/opencl/global.hpp"
#include "caf/opencl/global.hpp"
...
@@ -53,11 +53,11 @@ public:
...
@@ -53,11 +53,11 @@ public:
/// (Returns only devices of the first discovered platform).
/// (Returns only devices of the first discovered platform).
const
std
::
vector
<
device
>&
get_devices
()
const
CAF_DEPRECATED
;
const
std
::
vector
<
device
>&
get_devices
()
const
CAF_DEPRECATED
;
/// Get the device with id. These ids are assigned sequientally to all available devices.
/// Get the device with id. These ids are assigned sequientally to all available devices.
const
optional
<
const
device
&>
get_device
(
size_t
id
=
0
)
const
;
const
maybe
<
const
device
&>
get_device
(
size_t
id
=
0
)
const
;
/// Get the first device that satisfies the predicate.
/// Get the first device that satisfies the predicate.
/// The predicate should accept a `const device&` and return a bool;
/// The predicate should accept a `const device&` and return a bool;
template
<
class
UnaryPredicate
>
template
<
class
UnaryPredicate
>
const
optional
<
const
device
&>
get_device_if
(
UnaryPredicate
p
)
const
{
const
maybe
<
const
device
&>
get_device_if
(
UnaryPredicate
p
)
const
{
for
(
auto
&
pl
:
platforms_
)
{
for
(
auto
&
pl
:
platforms_
)
{
for
(
auto
&
dev
:
pl
.
get_devices
())
{
for
(
auto
&
dev
:
pl
.
get_devices
())
{
if
(
p
(
dev
))
if
(
p
(
dev
))
...
...
libcaf_opencl/caf/opencl/spawn_cl.hpp
View file @
b524a6c3
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <algorithm>
#include <algorithm>
#include <functional>
#include <functional>
#include "caf/
optional
.hpp"
#include "caf/
maybe
.hpp"
#include "caf/actor_cast.hpp"
#include "caf/actor_cast.hpp"
#include "caf/detail/limited_vector.hpp"
#include "caf/detail/limited_vector.hpp"
...
@@ -43,7 +43,7 @@ struct tuple_construct { };
...
@@ -43,7 +43,7 @@ struct tuple_construct { };
template
<
class
...
Ts
>
template
<
class
...
Ts
>
struct
cl_spawn_helper
{
struct
cl_spawn_helper
{
using
impl
=
opencl
::
actor_facade
<
Ts
...
>
;
using
impl
=
opencl
::
actor_facade
<
Ts
...
>
;
using
map_in_fun
=
std
::
function
<
optional
<
message
>
(
message
&
)
>
;
using
map_in_fun
=
std
::
function
<
maybe
<
message
>
(
message
&
)
>
;
using
map_out_fun
=
typename
impl
::
output_mapping
;
using
map_out_fun
=
typename
impl
::
output_mapping
;
actor
operator
()(
const
opencl
::
program
&
p
,
const
char
*
fn
,
actor
operator
()(
const
opencl
::
program
&
p
,
const
char
*
fn
,
...
@@ -177,7 +177,7 @@ template <class Fun, class... Ts>
...
@@ -177,7 +177,7 @@ template <class Fun, class... Ts>
actor
spawn_cl
(
const
opencl
::
program
&
prog
,
actor
spawn_cl
(
const
opencl
::
program
&
prog
,
const
char
*
fname
,
const
char
*
fname
,
const
opencl
::
spawn_config
&
config
,
const
opencl
::
spawn_config
&
config
,
std
::
function
<
optional
<
message
>
(
message
&
)
>
map_args
,
std
::
function
<
maybe
<
message
>
(
message
&
)
>
map_args
,
Fun
map_result
,
Fun
map_result
,
Ts
...
xs
)
{
Ts
...
xs
)
{
detail
::
cl_spawn_helper
<
Ts
...
>
f
;
detail
::
cl_spawn_helper
<
Ts
...
>
f
;
...
@@ -194,7 +194,7 @@ template <class Fun, class... Ts>
...
@@ -194,7 +194,7 @@ template <class Fun, class... Ts>
actor
spawn_cl
(
const
char
*
source
,
actor
spawn_cl
(
const
char
*
source
,
const
char
*
fname
,
const
char
*
fname
,
const
opencl
::
spawn_config
&
config
,
const
opencl
::
spawn_config
&
config
,
std
::
function
<
optional
<
message
>
(
message
&
)
>
map_args
,
std
::
function
<
maybe
<
message
>
(
message
&
)
>
map_args
,
Fun
map_result
,
Fun
map_result
,
Ts
...
xs
)
{
Ts
...
xs
)
{
detail
::
cl_spawn_helper
<
Ts
...
>
f
;
detail
::
cl_spawn_helper
<
Ts
...
>
f
;
...
@@ -227,7 +227,7 @@ actor spawn_cl(const char* source,
...
@@ -227,7 +227,7 @@ actor spawn_cl(const char* source,
template
<
class
Signature
,
class
Fun
>
template
<
class
Signature
,
class
Fun
>
actor
spawn_cl
(
const
opencl
::
program
&
prog
,
actor
spawn_cl
(
const
opencl
::
program
&
prog
,
const
char
*
fname
,
const
char
*
fname
,
std
::
function
<
optional
<
message
>
(
message
&
)
>
map_args
,
std
::
function
<
maybe
<
message
>
(
message
&
)
>
map_args
,
Fun
map_result
,
Fun
map_result
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
offset
=
{},
const
opencl
::
dim_vec
&
offset
=
{},
...
@@ -237,7 +237,7 @@ actor spawn_cl(const opencl::program& prog,
...
@@ -237,7 +237,7 @@ actor spawn_cl(const opencl::program& prog,
template
<
class
Signature
,
class
Fun
>
template
<
class
Signature
,
class
Fun
>
actor
spawn_cl
(
const
char
*
source
,
actor
spawn_cl
(
const
char
*
source
,
const
char
*
fname
,
const
char
*
fname
,
std
::
function
<
optional
<
message
>
(
message
&
)
>
map_args
,
std
::
function
<
maybe
<
message
>
(
message
&
)
>
map_args
,
Fun
map_result
,
Fun
map_result
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
offset
=
{},
const
opencl
::
dim_vec
&
offset
=
{},
...
@@ -286,7 +286,7 @@ actor spawn_cl(const char* source,
...
@@ -286,7 +286,7 @@ actor spawn_cl(const char* source,
template
<
class
Signature
,
class
Fun
>
template
<
class
Signature
,
class
Fun
>
actor
spawn_cl
(
const
opencl
::
program
&
prog
,
actor
spawn_cl
(
const
opencl
::
program
&
prog
,
const
char
*
fname
,
const
char
*
fname
,
std
::
function
<
optional
<
message
>
(
message
&
)
>
map_args
,
std
::
function
<
maybe
<
message
>
(
message
&
)
>
map_args
,
Fun
map_result
,
Fun
map_result
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
offset
,
const
opencl
::
dim_vec
&
offset
,
...
@@ -305,7 +305,7 @@ actor spawn_cl(const opencl::program& prog,
...
@@ -305,7 +305,7 @@ actor spawn_cl(const opencl::program& prog,
template
<
class
Signature
,
class
Fun
>
template
<
class
Signature
,
class
Fun
>
actor
spawn_cl
(
const
char
*
source
,
actor
spawn_cl
(
const
char
*
source
,
const
char
*
fname
,
const
char
*
fname
,
std
::
function
<
optional
<
message
>
(
message
&
)
>
map_args
,
std
::
function
<
maybe
<
message
>
(
message
&
)
>
map_args
,
Fun
map_result
,
Fun
map_result
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
dims
,
const
opencl
::
dim_vec
&
offset
,
const
opencl
::
dim_vec
&
offset
,
...
...
libcaf_opencl/examples/proper_matrix.cpp
View file @
b524a6c3
...
@@ -145,7 +145,7 @@ void multiplier(event_based_actor* self) {
...
@@ -145,7 +145,7 @@ void multiplier(event_based_actor* self) {
cout
<<
"calculating square of matrix:"
<<
endl
cout
<<
"calculating square of matrix:"
<<
endl
<<
to_string
(
m1
)
<<
endl
;
<<
to_string
(
m1
)
<<
endl
;
auto
unbox_args
=
[](
message
&
msg
)
->
optional
<
message
>
{
auto
unbox_args
=
[](
message
&
msg
)
->
maybe
<
message
>
{
return
msg
.
apply
(
return
msg
.
apply
(
[](
matrix_type
&
lhs
,
matrix_type
&
rhs
)
{
[](
matrix_type
&
lhs
,
matrix_type
&
rhs
)
{
return
make_message
(
std
::
move
(
lhs
.
data
()),
std
::
move
(
rhs
.
data
()));
return
make_message
(
std
::
move
(
lhs
.
data
()),
std
::
move
(
rhs
.
data
()));
...
...
libcaf_opencl/src/metainfo.cpp
View file @
b524a6c3
...
@@ -37,7 +37,7 @@ const std::vector<device>& metainfo::get_devices() const {
...
@@ -37,7 +37,7 @@ const std::vector<device>& metainfo::get_devices() const {
return
platforms_
.
front
().
get_devices
();
return
platforms_
.
front
().
get_devices
();
}
}
const
optional
<
const
device
&>
metainfo
::
get_device
(
size_t
id
)
const
{
const
maybe
<
const
device
&>
metainfo
::
get_device
(
size_t
id
)
const
{
if
(
platforms_
.
empty
())
if
(
platforms_
.
empty
())
return
none
;
return
none
;
size_t
to
=
0
;
size_t
to
=
0
;
...
...
libcaf_opencl/test/opencl.cpp
View file @
b524a6c3
...
@@ -252,7 +252,7 @@ void test_opencl() {
...
@@ -252,7 +252,7 @@ void test_opencl() {
}
}
);
);
const
matrix_type
expected2
(
move
(
expected1
));
const
matrix_type
expected2
(
move
(
expected1
));
auto
map_arg
=
[](
message
&
msg
)
->
optional
<
message
>
{
auto
map_arg
=
[](
message
&
msg
)
->
maybe
<
message
>
{
return
msg
.
apply
(
return
msg
.
apply
(
[](
matrix_type
&
mx
)
{
[](
matrix_type
&
mx
)
{
return
make_message
(
move
(
mx
.
data
()));
return
make_message
(
move
(
mx
.
data
()));
...
...
libcaf_opencl/test/opencl_deprecated.cpp
View file @
b524a6c3
...
@@ -208,7 +208,7 @@ void test_opencl_deprecated() {
...
@@ -208,7 +208,7 @@ void test_opencl_deprecated() {
}
}
);
);
const
matrix_type
expected2
(
std
::
move
(
expected1
));
const
matrix_type
expected2
(
std
::
move
(
expected1
));
auto
map_arg
=
[](
message
&
msg
)
->
optional
<
message
>
{
auto
map_arg
=
[](
message
&
msg
)
->
maybe
<
message
>
{
return
msg
.
apply
(
return
msg
.
apply
(
[](
matrix_type
&
mx
)
{
[](
matrix_type
&
mx
)
{
return
make_message
(
std
::
move
(
mx
.
data
()));
return
make_message
(
std
::
move
(
mx
.
data
()));
...
...
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