From df7638c3058c59b173f04cadef78c1955ac008f6 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 26 Feb 2017 14:31:05 +0100 Subject: Fixed an out-of-bounds memory access when filling a matrix with a constant --- src/kernels/level3/level3.opencl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernels/level3') diff --git a/src/kernels/level3/level3.opencl b/src/kernels/level3/level3.opencl index 0f5a8607..5ba8cf29 100644 --- a/src/kernels/level3/level3.opencl +++ b/src/kernels/level3/level3.opencl @@ -77,12 +77,12 @@ R"( #if defined(ROUTINE_INVERT) || defined(ROUTINE_TRSM) __kernel __attribute__((reqd_work_group_size(8, 8, 1))) -void FillMatrix(const int n, const int ld, const int offset, +void FillMatrix(const int m, const int n, const int ld, const int offset, __global real* restrict dest, const real_arg arg_value) { const real value = GetRealArg(arg_value); const int id_one = get_global_id(0); const int id_two = get_global_id(1); - if (id_one < ld && id_two < n) { + if (id_one < m && id_two < n) { dest[id_two*ld + id_one + offset] = value; } } -- cgit v1.2.3