Commit 9bf318f8 authored by Joseph Noir's avatar Joseph Noir

spawn_cl can now handle opencl::program

The kernel source can now be passed to spawn_cl in form
of a cppa::opencl::program. A test for this was added to
test_opencl.
parent c5c80453
...@@ -50,6 +50,11 @@ struct cl_spawn_helper<R (Ts...)> { ...@@ -50,6 +50,11 @@ struct cl_spawn_helper<R (Ts...)> {
auto cd = opencl::get_command_dispatcher(); auto cd = opencl::get_command_dispatcher();
return cd->spawn<R, Ts...>(p, fname, std::forward<Us>(args)...); return cd->spawn<R, Ts...>(p, fname, std::forward<Us>(args)...);
} }
template<typename... Us>
actor_ptr operator()(const opencl::program& p, const char* fname, Us&&... args) {
auto cd = opencl::get_command_dispatcher();
return cd->spawn<R, Ts...>(p, fname, std::forward<Us>(args)...);
}
}; };
template<typename MapArgs, typename MapResult> template<typename MapArgs, typename MapResult>
......
...@@ -107,7 +107,8 @@ int main() { ...@@ -107,7 +107,8 @@ int main() {
,152,174,196,218 ,152,174,196,218
,248,286,324,362 ,248,286,324,362
,344,398,452,506}; ,344,398,452,506};
auto worker1 = spawn_cl<ivec(ivec&)>(kernel_source, kernel_name, auto worker1 = spawn_cl<ivec(ivec&)>(program::create(kernel_source),
kernel_name,
{matrix_size,matrix_size}); {matrix_size,matrix_size});
ivec m1(matrix_size * matrix_size); ivec m1(matrix_size * matrix_size);
iota(m1.begin(), m1.end(), 0); iota(m1.begin(), m1.end(), 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment