Skip to content

Commit 6e8c857

Browse files
committed
fix zeCommandListAppendMemoryFill bug
Signed-off-by: Mateusz P. Nowak <[email protected]>
1 parent 6872601 commit 6e8c857

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ ur_result_t ur_command_list_manager::appendGenericFillUnlocked(
3838

3939
// PatternSize must be a power of two for zeCommandListAppendMemoryFill.
4040
// When it's not, the fill is emulated with zeCommandListAppendMemoryCopy.
41-
if (isPowerOf2(patternSize)) {
41+
// WORKAROUND: Level Zero driver rejects zeCommandListAppendMemoryFill when
42+
// patternSize == size, returning ZE_RESULT_ERROR_INVALID_SIZE (0x78000008).
43+
if (isPowerOf2(patternSize) && patternSize != size) {
4244
ZE2UR_CALL(zeCommandListAppendMemoryFill,
4345
(zeCommandList.get(), pDst, pPattern, patternSize, size,
4446
zeSignalEvent, waitListView.num, waitListView.handles));

0 commit comments

Comments
 (0)