Skip to content

Commit

Permalink
Added condition with isPowerOf2 to opencl Fill
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkusiak97 committed Mar 27, 2024
1 parent eb61ab9 commit 617d8ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/adapters/opencl/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
//
//===----------------------------------------------------------------------===//

#include <ur/ur.hpp>

#include "common.hpp"

inline cl_mem_alloc_flags_intel
Expand Down Expand Up @@ -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<clEnqueueMemFillINTEL_fn>(
Expand Down

0 comments on commit 617d8ad

Please sign in to comment.