From f77b48692b5dbc9f13f5f93a8242ea546a39236e Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Wed, 12 Jul 2017 21:53:39 +0200 Subject: Relaxed requirement on a_ld and b_ld for batched GEMM --- src/routines/levelx/xgemmbatched.cpp | 4 ++-- src/utilities/buffer_test.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/routines/levelx/xgemmbatched.cpp b/src/routines/levelx/xgemmbatched.cpp index 0fea1922..ee8448d2 100644 --- a/src/routines/levelx/xgemmbatched.cpp +++ b/src/routines/levelx/xgemmbatched.cpp @@ -94,8 +94,8 @@ void XgemmBatched::DoGemmBatched(const Layout layout, const Transpose a_trans // Tests the matrices for validity for (auto batch = size_t{0}; batch < batch_count; ++batch) { - TestMatrixA(a_one, a_two, a_buffer, a_offsets[batch], a_ld); - TestMatrixB(b_one, b_two, b_buffer, b_offsets[batch], b_ld); + TestMatrixA(a_one, a_two, a_buffer, a_offsets[batch], a_ld, false); // don't test for invalid LD + TestMatrixB(b_one, b_two, b_buffer, b_offsets[batch], b_ld, false); // don't test for invalid LD TestMatrixC(c_one, c_two, c_buffer, c_offsets[batch], c_ld); } diff --git a/src/utilities/buffer_test.hpp b/src/utilities/buffer_test.hpp index 652ab8c6..b5693181 100644 --- a/src/utilities/buffer_test.hpp +++ b/src/utilities/buffer_test.hpp @@ -23,8 +23,8 @@ namespace clblast { // Tests matrix 'A' for validity template void TestMatrixA(const size_t one, const size_t two, const Buffer &buffer, - const size_t offset, const size_t ld) { - if (ld < one) { throw BLASError(StatusCode::kInvalidLeadDimA); } + const size_t offset, const size_t ld, const bool test_lead_dim = true) { + if (test_lead_dim && ld < one) { throw BLASError(StatusCode::kInvalidLeadDimA); } try { const auto required_size = (ld * (two - 1) + one + offset) * sizeof(T); if (buffer.GetSize() < required_size) { throw BLASError(StatusCode::kInsufficientMemoryA); } @@ -34,8 +34,8 @@ void TestMatrixA(const size_t one, const size_t two, const Buffer &buffer, // Tests matrix 'B' for validity template void TestMatrixB(const size_t one, const size_t two, const Buffer &buffer, - const size_t offset, const size_t ld) { - if (ld < one) { throw BLASError(StatusCode::kInvalidLeadDimB); } + const size_t offset, const size_t ld, const bool test_lead_dim = true) { + if (test_lead_dim && ld < one) { throw BLASError(StatusCode::kInvalidLeadDimB); } try { const auto required_size = (ld * (two - 1) + one + offset) * sizeof(T); if (buffer.GetSize() < required_size) { throw BLASError(StatusCode::kInsufficientMemoryB); } -- cgit v1.2.3