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
0404a7ba
Unverified
Commit
0404a7ba
authored
Jan 22, 2018
by
Dominik Charousset
Committed by
GitHub
Jan 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #654
Replace throw with CAF_RAISE_ERROR
parents
ff793263
6a989521
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
16 deletions
+14
-16
libcaf_core/caf/deserializer.hpp
libcaf_core/caf/deserializer.hpp
+1
-1
libcaf_core/caf/serializer.hpp
libcaf_core/caf/serializer.hpp
+1
-1
libcaf_opencl/caf/opencl/actor_facade.hpp
libcaf_opencl/caf/opencl/actor_facade.hpp
+2
-4
libcaf_opencl/caf/opencl/command.hpp
libcaf_opencl/caf/opencl/command.hpp
+1
-1
libcaf_opencl/src/manager.cpp
libcaf_opencl/src/manager.cpp
+7
-7
libcaf_opencl/src/opencl_err.cpp
libcaf_opencl/src/opencl_err.cpp
+1
-1
libcaf_opencl/src/platform.cpp
libcaf_opencl/src/platform.cpp
+1
-1
No files found.
libcaf_core/caf/deserializer.hpp
View file @
0404a7ba
...
...
@@ -67,7 +67,7 @@ typename std::enable_if<
operator
&
(
deserializer
&
source
,
T
&
x
)
{
auto
e
=
source
.
apply
(
x
);
if
(
e
)
throw
std
::
runtime_error
(
to_string
(
e
));
CAF_RAISE_ERROR
(
to_string
(
e
));
}
template
<
class
T
>
...
...
libcaf_core/caf/serializer.hpp
View file @
0404a7ba
...
...
@@ -67,7 +67,7 @@ operator&(serializer& sink, const T& x) {
// implementations are required to never modify `x` while saving
auto
e
=
sink
.
apply
(
const_cast
<
T
&>
(
x
));
if
(
e
)
throw
std
::
runtime_error
(
to_string
(
e
));
CAF_RAISE_ERROR
(
to_string
(
e
));
}
template
<
class
T
>
...
...
libcaf_opencl/caf/opencl/actor_facade.hpp
View file @
0404a7ba
...
...
@@ -89,16 +89,14 @@ public:
Ts
&&
...
xs
)
{
if
(
range
.
dimensions
().
empty
())
{
auto
str
=
"OpenCL kernel needs at least 1 global dimension."
;
CAF_LOG_ERROR
(
str
);
throw
std
::
runtime_error
(
str
);
CAF_RAISE_ERROR
(
str
);
}
auto
check_vec
=
[
&
](
const
dim_vec
&
vec
,
const
char
*
name
)
{
if
(
!
vec
.
empty
()
&&
vec
.
size
()
!=
range
.
dimensions
().
size
())
{
std
::
ostringstream
oss
;
oss
<<
name
<<
" vector is not empty, but "
<<
"its size differs from global dimensions vector's size"
;
CAF_LOG_ERROR
(
CAF_ARG
(
oss
.
str
()));
throw
std
::
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
};
check_vec
(
range
.
offsets
(),
"offsets"
);
...
...
libcaf_opencl/caf/opencl/command.hpp
View file @
0404a7ba
...
...
@@ -197,7 +197,7 @@ private:
events
.
data
(),
&
events
.
back
());
if
(
err
!=
CL_SUCCESS
)
{
this
->
deref
();
// failed to enqueue command
throw
std
::
runtime_error
(
"clEnqueueReadBuffer: "
+
opencl_error
(
err
));
CAF_RAISE_ERROR
(
"clEnqueueReadBuffer: "
+
opencl_error
(
err
));
}
pos
+=
1
;
}
...
...
libcaf_opencl/src/manager.cpp
View file @
0404a7ba
...
...
@@ -53,7 +53,7 @@ void manager::init(actor_system_config&) {
std
::
vector
<
cl_platform_id
>
platform_ids
(
num_platforms
);
v2callcl
(
CAF_CLF
(
clGetPlatformIDs
),
num_platforms
,
platform_ids
.
data
());
if
(
platform_ids
.
empty
())
throw
std
::
runtime_error
(
"no OpenCL platform found"
);
CAF_RAISE_ERROR
(
"no OpenCL platform found"
);
// initialize platforms (device discovery)
unsigned
current_device_id
=
0
;
for
(
auto
&
pl_id
:
platform_ids
)
{
...
...
@@ -100,7 +100,7 @@ program_ptr manager::create_program_from_file(const char* path,
ostringstream
oss
;
oss
<<
"No file at '"
<<
path
<<
"' found."
;
CAF_LOG_ERROR
(
CAF_ARG
(
oss
.
str
()));
throw
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
return
create_program
(
kernel_source
.
c_str
(),
options
,
device_id
);
}
...
...
@@ -113,7 +113,7 @@ program_ptr manager::create_program(const char* kernel_source,
ostringstream
oss
;
oss
<<
"No device with id '"
<<
device_id
<<
"' found."
;
CAF_LOG_ERROR
(
CAF_ARG
(
oss
.
str
()));
throw
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
return
create_program
(
kernel_source
,
options
,
*
dev
);
}
...
...
@@ -134,7 +134,7 @@ program_ptr manager::create_program_from_file(const char* path,
ostringstream
oss
;
oss
<<
"No file at '"
<<
path
<<
"' found."
;
CAF_LOG_ERROR
(
CAF_ARG
(
oss
.
str
()));
throw
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
return
create_program
(
kernel_source
.
c_str
(),
options
,
dev
);
}
...
...
@@ -176,7 +176,7 @@ program_ptr manager::create_program(const char* kernel_source,
#endif
oss
<<
endl
<<
ss
.
str
();
}
throw
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
cl_uint
number_of_kernels
=
0
;
clCreateKernelsInProgram
(
pptr
.
get
(),
0u
,
nullptr
,
&
number_of_kernels
);
...
...
@@ -188,7 +188,7 @@ program_ptr manager::create_program(const char* kernel_source,
if
(
err
!=
CL_SUCCESS
)
{
ostringstream
oss
;
oss
<<
"clCreateKernelsInProgram: "
<<
opencl_error
(
err
);
throw
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
for
(
cl_uint
i
=
0
;
i
<
number_of_kernels
;
++
i
)
{
size_t
len
;
...
...
@@ -200,7 +200,7 @@ program_ptr manager::create_program(const char* kernel_source,
ostringstream
oss
;
oss
<<
"clGetKernelInfo (CL_KERNEL_FUNCTION_NAME): "
<<
opencl_error
(
err
);
throw
runtime_error
(
oss
.
str
());
CAF_RAISE_ERROR
(
oss
.
str
());
}
detail
::
raw_kernel_ptr
kernel
;
kernel
.
reset
(
move
(
kernels
[
i
]));
...
...
libcaf_opencl/src/opencl_err.cpp
View file @
0404a7ba
...
...
@@ -27,7 +27,7 @@ void throwcl(const char* fname, cl_int err) {
std
::
string
errstr
=
fname
;
errstr
+=
": "
;
errstr
+=
opencl_error
(
err
);
throw
std
::
runtime_error
(
std
::
move
(
errstr
));
CAF_RAISE_ERROR
(
std
::
move
(
errstr
));
}
}
...
...
libcaf_opencl/src/platform.cpp
View file @
0404a7ba
...
...
@@ -66,7 +66,7 @@ platform_ptr platform::create(cl_platform_id platform_id,
if
(
device_information
.
empty
())
{
string
errstr
=
"no devices for the platform found"
;
CAF_LOG_ERROR
(
CAF_ARG
(
errstr
));
throw
runtime_error
(
move
(
errstr
));
CAF_RAISE_ERROR
(
move
(
errstr
));
}
auto
name
=
platform_info
(
platform_id
,
CL_PLATFORM_NAME
);
auto
vendor
=
platform_info
(
platform_id
,
CL_PLATFORM_VENDOR
);
...
...
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