diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-03-08 20:10:20 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-03-08 20:10:20 +0100 |
commit | fa0a9c689fc21a2a24aeadf82ae0acdf6d8bf831 (patch) | |
tree | 404e85900a4c9038d407addb38798d06bb48868c /test/routines/level3/xgemm.hpp | |
parent | 6aba0bbae71702c4eebd88d0fe17739b509185c1 (diff) |
Make batched routines based on offsets instead of a vector of cl_mem objects - undoing many earlier changes
Diffstat (limited to 'test/routines/level3/xgemm.hpp')
-rw-r--r-- | test/routines/level3/xgemm.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/routines/level3/xgemm.hpp b/test/routines/level3/xgemm.hpp index 5b220889..1b12fb1c 100644 --- a/test/routines/level3/xgemm.hpp +++ b/test/routines/level3/xgemm.hpp @@ -88,14 +88,14 @@ class TestXgemm { std::vector<T>&, std::vector<T>&) {} // N/A for this routine // Describes how to run the CLBlast routine - static StatusCode RunRoutine(const Arguments<T> &args, std::vector<Buffers<T>> &buffers, Queue &queue) { + static StatusCode RunRoutine(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); auto event = cl_event{}; auto status = Gemm(args.layout, args.a_transpose, args.b_transpose, args.m, args.n, args.k, args.alpha, - buffers[0].a_mat(), args.a_offset, args.a_ld, - buffers[0].b_mat(), args.b_offset, args.b_ld, args.beta, - buffers[0].c_mat(), args.c_offset, args.c_ld, + 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); } return status; @@ -103,16 +103,16 @@ class TestXgemm { // Describes how to run the clBLAS routine (for correctness/performance comparison) #ifdef CLBLAST_REF_CLBLAS - static StatusCode RunReference1(const Arguments<T> &args, std::vector<Buffers<T>> &buffers, Queue &queue) { + static StatusCode RunReference1(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); auto event = cl_event{}; auto status = clblasXgemm(convertToCLBLAS(args.layout), convertToCLBLAS(args.a_transpose), convertToCLBLAS(args.b_transpose), args.m, args.n, args.k, args.alpha, - buffers[0].a_mat, args.a_offset, args.a_ld, - buffers[0].b_mat, args.b_offset, args.b_ld, args.beta, - buffers[0].c_mat, args.c_offset, args.c_ld, + 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, 1, &queue_plain, 0, nullptr, &event); clWaitForEvents(1, &event); return static_cast<StatusCode>(status); @@ -121,13 +121,13 @@ class TestXgemm { // Describes how to run the CPU BLAS routine (for correctness/performance comparison) #ifdef CLBLAST_REF_CBLAS - static StatusCode RunReference2(const Arguments<T> &args, std::vector<Buffers<T>> &buffers, Queue &queue) { + static StatusCode RunReference2(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) { std::vector<T> a_mat_cpu(args.a_size, static_cast<T>(0)); std::vector<T> b_mat_cpu(args.b_size, static_cast<T>(0)); std::vector<T> c_mat_cpu(args.c_size, static_cast<T>(0)); - buffers[0].a_mat.Read(queue, args.a_size, a_mat_cpu); - buffers[0].b_mat.Read(queue, args.b_size, b_mat_cpu); - buffers[0].c_mat.Read(queue, args.c_size, c_mat_cpu); + buffers.a_mat.Read(queue, args.a_size, a_mat_cpu); + buffers.b_mat.Read(queue, args.b_size, b_mat_cpu); + buffers.c_mat.Read(queue, args.c_size, c_mat_cpu); cblasXgemm(convertToCBLAS(args.layout), convertToCBLAS(args.a_transpose), convertToCBLAS(args.b_transpose), @@ -135,7 +135,7 @@ class TestXgemm { a_mat_cpu, args.a_offset, args.a_ld, b_mat_cpu, args.b_offset, args.b_ld, args.beta, c_mat_cpu, args.c_offset, args.c_ld); - buffers[0].c_mat.Write(queue, args.c_size, c_mat_cpu); + buffers.c_mat.Write(queue, args.c_size, c_mat_cpu); return StatusCode::kSuccess; } #endif |