Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions sycl/test-e2e/Graph/NativeCommand/level-zero_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// REQUIRES: level_zero, level_zero_dev_kit

// UNSUPPORTED: level_zero_v2_adapter
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17847

#include <level_zero/ze_api.h>
#include <sycl/backend.hpp>
#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand All @@ -26,7 +23,7 @@ int main() {
return 1;
}

queue Queue;
queue Queue{{property::queue::in_order{}}};

const size_t Size = 128;
int *PtrX = malloc_device<int>(Size, Queue);
Expand Down
18 changes: 11 additions & 7 deletions unified-runtime/source/adapters/level_zero/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1897,17 +1897,21 @@ ur_result_t urCommandBufferAppendNativeCommandExp(
numSyncPointsInWaitList, pSyncPointWaitList, true, pSyncPoint,
ZeEventList, ZeLaunchEvent));

// Barrier on all commands before user defined commands.
ZE2UR_CALL(zeCommandListAppendBarrier,
(ZeCommandList, nullptr, ZeEventList.size(),
getPointerFromVector(ZeEventList)));
if (!hCommandBuffer->IsInOrderCmdList) {
// Barrier on all commands before user defined commands.
ZE2UR_CALL(zeCommandListAppendBarrier,
(ZeCommandList, nullptr, ZeEventList.size(),
getPointerFromVector(ZeEventList)));
}

// Call user-defined function immediately
pfnNativeCommand(pData);

// Barrier on all commands after user defined commands.
ZE2UR_CALL(zeCommandListAppendBarrier,
(ZeCommandList, ZeLaunchEvent, 0, nullptr));
if (!hCommandBuffer->IsInOrderCmdList) {
// Barrier on all commands after user defined commands.
ZE2UR_CALL(zeCommandListAppendBarrier,
(ZeCommandList, ZeLaunchEvent, 0, nullptr));
}

return UR_RESULT_SUCCESS;
}
Expand Down
Loading