Skip to content

Commit 08f4c75

Browse files
Konrad Kusiakkbenzie
authored andcommitted
Added condition with isPowerOf2 to opencl Fill
1 parent 3948742 commit 08f4c75

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

source/adapters/level_zero/memory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType,
242242
(ZeCommandList, Ptr, Pattern, PatternSize, Size, ZeEvent,
243243
WaitList.Length, WaitList.ZeEventList));
244244

245-
logger::debug("calling zeCommandListAppendMemoryFill() with"
246-
" ZeEvent {}",
247-
ur_cast<uint64_t>(ZeEvent));
248-
printZeEventList(WaitList);
245+
logger::debug("calling zeCommandListAppendMemoryFill() with"
246+
" ZeEvent {}",
247+
ur_cast<uint64_t>(ZeEvent));
248+
printZeEventList(WaitList);
249249

250250
// Execute command list asynchronously, as the event will be used
251251
// to track down its completion.

source/adapters/opencl/usm.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//
99
//===----------------------------------------------------------------------===//
1010

11+
#include <ur/ur.hpp>
12+
1113
#include "common.hpp"
1214

1315
inline cl_mem_alloc_flags_intel
@@ -239,7 +241,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill(
239241
return mapCLErrorToUR(CLErr);
240242
}
241243

242-
if (patternSize <= 128) {
244+
if (patternSize <= 128 && isPowerOf2(patternSize)) {
243245
clEnqueueMemFillINTEL_fn EnqueueMemFill = nullptr;
244246
UR_RETURN_ON_FAILURE(
245247
cl_ext::getExtFuncFromContext<clEnqueueMemFillINTEL_fn>(

0 commit comments

Comments
 (0)