From 01d254c0b09549bb7921d1c777d1d53042c5d466 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 27 May 2018 18:38:47 +0200 Subject: Added a check to return 'NotImplemented' error code in case of systems with < 16 LWGS for TSRV and TRSM --- src/routines/level2/xtrsv.cpp | 5 +++++ src/routines/level3/xtrsm.cpp | 5 +++++ src/routines/levelx/xinvert.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/routines/level2/xtrsv.cpp b/src/routines/level2/xtrsv.cpp index c474db4c..5d2ddf54 100644 --- a/src/routines/level2/xtrsv.cpp +++ b/src/routines/level2/xtrsv.cpp @@ -87,6 +87,11 @@ void Xtrsv::DoTrsv(const Layout layout, const Triangle triangle, // Makes sure all dimensions are larger than zero if (n == 0) { throw BLASError(StatusCode::kInvalidDimension); } + // Some parts of this kernel are not tunable and thus require some minimal OpenCL properties + if (device_.MaxWorkGroupSize() < 16) { // minimum of total local work size of 16 + throw RuntimeErrorCode(StatusCode::kNotImplemented); + } + // Tests the matrix and vector TestMatrixA(n, n, a_buffer, a_offset, a_ld); TestVectorX(n, b_buffer, b_offset, b_inc); diff --git a/src/routines/level3/xtrsm.cpp b/src/routines/level3/xtrsm.cpp index 255e1cca..905660ff 100644 --- a/src/routines/level3/xtrsm.cpp +++ b/src/routines/level3/xtrsm.cpp @@ -78,6 +78,11 @@ void Xtrsm::TrsmColMajor(const Side side, const Triangle triangle, // Makes sure all dimensions are larger than zero if ((m == 0) || (n == 0)) { throw BLASError(StatusCode::kInvalidDimension); } + // Some parts of this kernel are not tunable and thus require some minimal OpenCL properties + if (device_.MaxWorkGroupSize() < 16) { // minimum of total local work size of 16 + throw RuntimeErrorCode(StatusCode::kNotImplemented); + } + // Computes the k dimension. This is based on whether or not matrix is A (on the left) // or B (on the right) in the Xgemm routine. const auto k = (side == Side::kLeft) ? m : n; diff --git a/src/routines/levelx/xinvert.cpp b/src/routines/levelx/xinvert.cpp index d851e0b9..65a28d73 100644 --- a/src/routines/levelx/xinvert.cpp +++ b/src/routines/levelx/xinvert.cpp @@ -49,6 +49,11 @@ void Xinvert::InvertMatrixDiagonalBlocks(const Layout layout, const Triangle throw BLASError(StatusCode::kInvalidDimension); } + // Some parts of this kernel are not tunable and thus require some minimal OpenCL properties + if (device_.MaxWorkGroupSize() < 16) { // minimum of total local work size of 16 + throw RuntimeErrorCode(StatusCode::kNotImplemented); + } + // Helper variables const auto internal_block_size = static_cast(db_["INTERNAL_BLOCK_SIZE"]); assert(internal_block_size == 16); -- cgit v1.2.3