summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2019-01-05 10:56:35 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2019-01-05 10:56:35 +0100
commitafcf5dc6ebc287b392edcb6bd3ac48966ba98e3c (patch)
tree6b2a062733e22b928fbfdb95e18d2f35553bf44f /src
parent9819957768174dbb4929b970718a0d6018520979 (diff)
Added a check to prevent the stride of matrix C being set to 0 for the strided-batched-GEMM routine
Diffstat (limited to 'src')
-rw-r--r--src/routines/levelx/xgemmstridedbatched.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/routines/levelx/xgemmstridedbatched.cpp b/src/routines/levelx/xgemmstridedbatched.cpp
index d9e3ebba..5d8945ce 100644
--- a/src/routines/levelx/xgemmstridedbatched.cpp
+++ b/src/routines/levelx/xgemmstridedbatched.cpp
@@ -62,6 +62,9 @@ void XgemmStridedBatched<T>::DoGemmStridedBatched(const Layout layout, const Tra
throw BLASError(StatusCode::kInvalidBatchCount);
}
+ // Makes sure the strides are valid
+ if (c_stride == 0) { throw BLASError(StatusCode::kInvalidDimension); }
+
// Two methods to choose from, select which one to run
const auto do_gemm_direct = Xgemm<T>::UseDirectKernel(m, n, k, db_["XGEMM_MIN_INDIRECT_SIZE"]);
const auto gemm_kernel_id = (do_gemm_direct) ? 0 : db_["GEMMK"];