From 617d8adfbd9f5212a0fd9a5a89bf319bd9ba08db Mon Sep 17 00:00:00 2001 From: Konrad Kusiak Date: Fri, 8 Mar 2024 13:32:07 +0000 Subject: [PATCH] Added condition with isPowerOf2 to opencl Fill --- source/adapters/opencl/usm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/adapters/opencl/usm.cpp b/source/adapters/opencl/usm.cpp index 0d64f23d13..3f4382fc0d 100644 --- a/source/adapters/opencl/usm.cpp +++ b/source/adapters/opencl/usm.cpp @@ -8,6 +8,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "common.hpp" inline cl_mem_alloc_flags_intel @@ -239,7 +241,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill( return mapCLErrorToUR(CLErr); } - if (patternSize <= 128) { + if (patternSize <= 128 && isPowerOf2(patternSize)) { clEnqueueMemFillINTEL_fn EnqueueMemFill = nullptr; UR_RETURN_ON_FAILURE( cl_ext::getExtFuncFromContext(