Skip to content

Commit 47e59a8

Browse files
authored
Update usm.cpp
1 parent e256f54 commit 47e59a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/adapters/level_zero/usm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc(
309309
// L0 supports alignment up to 64KB and silently ignores higher values.
310310
// We flag alignment > 64KB as an invalid value.
311311
// L0 spec says that alignment values that are not powers of 2 are invalid.
312-
if (Align > 65536 || Align & (Align - 1) != 0)
312+
if (Align > 65536 || (Align & (Align - 1)) != 0)
313313
return UR_RESULT_ERROR_INVALID_VALUE;
314314

315315
ur_platform_handle_t Plt = Context->getPlatform();
@@ -379,7 +379,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMDeviceAlloc(
379379
// L0 supports alignment up to 64KB and silently ignores higher values.
380380
// We flag alignment > 64KB as an invalid value.
381381
// L0 spec says that alignment values that are not powers of 2 are invalid.
382-
if (Alignment > 65536 || Alignment & (Alignment - 1) != 0)
382+
if (Alignment > 65536 || (Alignment & (Alignment - 1)) != 0)
383383
return UR_RESULT_ERROR_INVALID_VALUE;
384384

385385
ur_platform_handle_t Plt = Device->Platform;
@@ -480,7 +480,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMSharedAlloc(
480480
// L0 supports alignment up to 64KB and silently ignores higher values.
481481
// We flag alignment > 64KB as an invalid value.
482482
// L0 spec says that alignment values that are not powers of 2 are invalid.
483-
if (Alignment > 65536 || Alignment & (Alignment - 1) != 0)
483+
if (Alignment > 65536 || (Alignment & (Alignment - 1)) != 0)
484484
return UR_RESULT_ERROR_INVALID_VALUE;
485485

486486
ur_platform_handle_t Plt = Device->Platform;

0 commit comments

Comments
 (0)