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
d76c7f43
Commit
d76c7f43
authored
Aug 10, 2016
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add handler for unexpected messages in opencl test
parent
c93bb3cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
libcaf_opencl/test/opencl.cpp
libcaf_opencl/test/opencl.cpp
+32
-0
No files found.
libcaf_opencl/test/opencl.cpp
View file @
d76c7f43
...
@@ -237,6 +237,10 @@ void test_opencl(actor_system& sys) {
...
@@ -237,6 +237,10 @@ void test_opencl(actor_system& sys) {
check_vector_results
(
"Simple matrix multiplication using vectors"
check_vector_results
(
"Simple matrix multiplication using vectors"
"(kernel wrapped in program)"
,
"(kernel wrapped in program)"
,
expected1
,
result
);
expected1
,
result
);
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
opencl
::
spawn_config
cfg2
{
dims
{
matrix_size
,
matrix_size
}};
opencl
::
spawn_config
cfg2
{
dims
{
matrix_size
,
matrix_size
}};
...
@@ -247,6 +251,10 @@ void test_opencl(actor_system& sys) {
...
@@ -247,6 +251,10 @@ void test_opencl(actor_system& sys) {
[
&
](
const
ivec
&
result
)
{
[
&
](
const
ivec
&
result
)
{
check_vector_results
(
"Simple matrix multiplication using vectors"
,
check_vector_results
(
"Simple matrix multiplication using vectors"
,
expected1
,
result
);
expected1
,
result
);
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
const
matrix_type
expected2
(
move
(
expected1
));
const
matrix_type
expected2
(
move
(
expected1
));
...
@@ -270,6 +278,10 @@ void test_opencl(actor_system& sys) {
...
@@ -270,6 +278,10 @@ void test_opencl(actor_system& sys) {
check_vector_results
(
"Matrix multiplication with user defined type "
check_vector_results
(
"Matrix multiplication with user defined type "
"(kernel wrapped in program)"
,
"(kernel wrapped in program)"
,
expected2
.
data
(),
result
.
data
());
expected2
.
data
(),
result
.
data
());
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
opencl
::
spawn_config
cfg4
{
dims
{
matrix_size
,
matrix_size
}};
opencl
::
spawn_config
cfg4
{
dims
{
matrix_size
,
matrix_size
}};
...
@@ -281,6 +293,10 @@ void test_opencl(actor_system& sys) {
...
@@ -281,6 +293,10 @@ void test_opencl(actor_system& sys) {
[
&
](
const
matrix_type
&
result
)
{
[
&
](
const
matrix_type
&
result
)
{
check_vector_results
(
"Matrix multiplication with user defined type"
,
check_vector_results
(
"Matrix multiplication with user defined type"
,
expected2
.
data
(),
result
.
data
());
expected2
.
data
(),
result
.
data
());
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
CAF_MESSAGE
(
"Expecting exception (compiling invalid kernel, "
CAF_MESSAGE
(
"Expecting exception (compiling invalid kernel, "
...
@@ -306,6 +322,10 @@ void test_opencl(actor_system& sys) {
...
@@ -306,6 +322,10 @@ void test_opencl(actor_system& sys) {
self
->
receive
(
self
->
receive
(
[
&
](
const
ivec
&
result
)
{
[
&
](
const
ivec
&
result
)
{
check_vector_results
(
"Passing compiler flags"
,
expected3
,
result
);
check_vector_results
(
"Passing compiler flags"
,
expected3
,
result
);
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
...
@@ -340,6 +360,10 @@ void test_opencl(actor_system& sys) {
...
@@ -340,6 +360,10 @@ void test_opencl(actor_system& sys) {
self
->
receive
(
self
->
receive
(
[
&
](
const
ivec
&
result
)
{
[
&
](
const
ivec
&
result
)
{
check_vector_results
(
"Passing size for the output"
,
expected4
,
result
);
check_vector_results
(
"Passing size for the output"
,
expected4
,
result
);
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
}
}
...
@@ -359,6 +383,10 @@ void test_opencl(actor_system& sys) {
...
@@ -359,6 +383,10 @@ void test_opencl(actor_system& sys) {
self
->
receive
(
self
->
receive
(
[
&
](
const
ivec
&
result
)
{
[
&
](
const
ivec
&
result
)
{
check_vector_results
(
"Using const input argument"
,
expected5
,
result
);
check_vector_results
(
"Using const input argument"
,
expected5
,
result
);
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
// test in_out argument type
// test in_out argument type
...
@@ -373,6 +401,10 @@ void test_opencl(actor_system& sys) {
...
@@ -373,6 +401,10 @@ void test_opencl(actor_system& sys) {
self
->
receive
(
self
->
receive
(
[
&
](
const
ivec
&
result
)
{
[
&
](
const
ivec
&
result
)
{
check_vector_results
(
"Testing in_out arugment"
,
expected9
,
result
);
check_vector_results
(
"Testing in_out arugment"
,
expected9
,
result
);
},
others
>>
[
&
](
message_view
&
x
)
->
result
<
message
>
{
CAF_ERROR
(
"unexpected message"
<<
x
.
content
().
stringify
());
return
sec
::
unexpected_message
;
}
}
);
);
}
}
...
...
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