summaryrefslogtreecommitdiff
path: root/test/routines/level3/xsymm.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-10-15 19:35:21 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-10-15 19:35:21 +0200
commite6da575fff9d55de2b83def06243ca8dc9038f40 (patch)
tree79366158ad584728673585ead2c96547353b983d /test/routines/level3/xsymm.hpp
parent7663cba23487290d7bf62c268410c840e3ee7972 (diff)
Modified test interfaces such that they support either OpenCL or CUDA
Diffstat (limited to 'test/routines/level3/xsymm.hpp')
-rw-r--r--test/routines/level3/xsymm.hpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/test/routines/level3/xsymm.hpp b/test/routines/level3/xsymm.hpp
index 5d840d40..90cc1888 100644
--- a/test/routines/level3/xsymm.hpp
+++ b/test/routines/level3/xsymm.hpp
@@ -83,15 +83,25 @@ class TestXsymm {
// 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 = Symm(args.layout, args.side, args.triangle,
- args.m, args.n, args.alpha,
- buffers.a_mat(), args.a_offset, args.a_ld,
- buffers.b_mat(), args.b_offset, args.b_ld, args.beta,
- buffers.c_mat(), args.c_offset, args.c_ld,
- &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 = Symm(args.layout, args.side, args.triangle,
+ args.m, args.n, args.alpha,
+ buffers.a_mat(), args.a_offset, args.a_ld,
+ buffers.b_mat(), args.b_offset, args.b_ld, args.beta,
+ buffers.c_mat(), args.c_offset, args.c_ld,
+ &queue_plain, &event);
+ if (status == StatusCode::kSuccess) { clWaitForEvents(1, &event); clReleaseEvent(event); }
+ #elif CUDA_API
+ auto status = Symm(args.layout, args.side, args.triangle,
+ args.m, args.n, args.alpha,
+ buffers.a_mat(), args.a_offset, args.a_ld,
+ buffers.b_mat(), args.b_offset, args.b_ld, args.beta,
+ buffers.c_mat(), args.c_offset, args.c_ld,
+ queue.GetContext()(), queue.GetDevice()());
+ cuStreamSynchronize(queue());
+ #endif
return status;
}