need a tutorial on clblast::copy
naturalmechanics opened this issue · comments
I have this code:
status = clblast::Copy(n,B_buffer(), xoff,incx,X_buffer(),yoff,incy, &queue_plain, &event);
n
, x/yOff
and incx/y
are defined as size_t. B/X_buffer
are created using cl::Buffer
function, as auto
types. All of these work fine in a clblast::Gemv
call.
But the Copy
call is giving me this error:
no matching function for call to 'Copy(size_t&, _cl_mem*&, const size_t&, _cl_mem*&, const size_t&, _cl_command_queue**, _cl_event**)'
/usr/include/clblast.h:185:12: note: candidate: 'template<class T> clblast::StatusCode clblast::Copy(size_t, cl_mem, size_t, size_t, cl_mem, size_t, size_t, _cl_command_queue**, _cl_event**)'
185 | StatusCode Copy(const size_t n,
| ^~~~
/usr/include/clblast.h:185:12: note: template argument deduction/substitution failed:
/run/media/monsoon/eaeb75de-3945-4f63-97c3-d3c4cbe506a8/Work/master/ma/commands/benchmark.cpp:398:43: note: couldn't deduce template parameter 'T'
However, there is no T
in teh c++ api of xCopy according to the api docs.
I think it is my mistake, I am looking for a tutorial to use the Copy
call correctly. Thank you.
The T
is not in the argument list, but in the template argument list. It is also in the docs and in the header file. The type T
tells the function whether your data is 32-bits or 64-bits (or even of complex data-type). In your example, assuming you are using 32-bits single-precision you should add <float>
after the function call, e.g.:
status = clblast::Copy<float>(n,B_buffer(), xoff,incx,X_buffer(),yoff,incy, &queue_plain, &event);
This works for both copy and swap. Thank you