summaryrefslogtreecommitdiff
path: root/test/routines/level1/xcopy.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-10-20 12:07:30 +0200
committerGitHub <noreply@github.com>2017-10-20 12:07:30 +0200
commit42dcd8fd8a81c66783827dc4826117b3af610376 (patch)
treea321cdec1fbb96ec54257b76dccb91184f01b015 /test/routines/level1/xcopy.hpp
parent48133a0cd1a7b61b87906ec1f4608e766e20a973 (diff)
parent363568787ebfcdc0c5e6af9c3c8e71c702e2f951 (diff)
Merge pull request #204 from CNugteren/cuda_api
Cuda API to CLBlast
Diffstat (limited to 'test/routines/level1/xcopy.hpp')
-rw-r--r--test/routines/level1/xcopy.hpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/routines/level1/xcopy.hpp b/test/routines/level1/xcopy.hpp
index 7a5c99b8..58abdbf4 100644
--- a/test/routines/level1/xcopy.hpp
+++ b/test/routines/level1/xcopy.hpp
@@ -69,13 +69,21 @@ class TestXcopy {
// Describes how to run the CLBlast routine
static StatusCode RunRoutine(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) {
- auto queue_plain = queue();
- auto event = cl_event{};
- auto status = Copy<T>(args.n,
- buffers.x_vec(), args.x_offset, args.x_inc,
- buffers.y_vec(), args.y_offset, args.y_inc,
- &queue_plain, &event);
- if (status == StatusCode::kSuccess) { clWaitForEvents(1, &event); clReleaseEvent(event); }
+ #ifdef OPENCL_API
+ auto queue_plain = queue();
+ auto event = cl_event{};
+ auto status = Copy<T>(args.n,
+ buffers.x_vec(), args.x_offset, args.x_inc,
+ buffers.y_vec(), args.y_offset, args.y_inc,
+ &queue_plain, &event);
+ if (status == StatusCode::kSuccess) { clWaitForEvents(1, &event); clReleaseEvent(event); }
+ #elif CUDA_API
+ auto status = Copy<T>(args.n,
+ buffers.x_vec(), args.x_offset, args.x_inc,
+ buffers.y_vec(), args.y_offset, args.y_inc,
+ queue.GetContext()(), queue.GetDevice()());
+ cuStreamSynchronize(queue());
+ #endif
return status;
}