Skip to content

Commit 00f958f

Browse files
authored
Merge pull request #2139 from nrspruit/zeHandle_copy_dependencies
[L0] Pass and track event dependencies required before executing Memory Copy buffer inits
2 parents cc2d590 + 98a67a2 commit 00f958f

File tree

6 files changed

+146
-59
lines changed

6 files changed

+146
-59
lines changed

.github/workflows/multi_device.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ jobs:
3030
- name: Install pip packages
3131
run: pip install -r third_party/requirements.txt
3232

33-
# TODO: enable once test failure are fixed/ignored
34-
# - name: Download DPC++
35-
# run: |
36-
# wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
37-
# mkdir dpcpp_compiler
38-
# tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
33+
- name: Download DPC++
34+
run: |
35+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
36+
mkdir dpcpp_compiler
37+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
3938
4039
- name: Configure CMake
4140
shell: bash -el {0}
@@ -49,6 +48,8 @@ jobs:
4948
-DUR_BUILD_TESTS=ON
5049
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
5150
-DUR_TEST_DEVICES_COUNT=2
51+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
52+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
5253
5354
- name: Build
5455
run: cmake --build ${{github.workspace}}/build -j $(nproc)
@@ -60,4 +61,4 @@ jobs:
6061

6162
- name: Test adapters
6263
working-directory: ${{github.workspace}}/build
63-
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
64+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "enqueue|kernel|program|integration|exp_command_buffer|exp_enqueue_native|exp_launch_properties|exp_usm_p2p" --timeout 180

source/adapters/level_zero/command_buffer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ setKernelPendingArguments(ur_exp_command_buffer_handle_t CommandBuffer,
672672
char **ZeHandlePtr = nullptr;
673673
if (Arg.Value) {
674674
UR_CALL(Arg.Value->getZeHandlePtr(ZeHandlePtr, Arg.AccessMode,
675-
CommandBuffer->Device));
675+
CommandBuffer->Device, nullptr, 0u));
676676
}
677677
ZE2UR_CALL(zeKernelSetArgumentValue,
678678
(Kernel->ZeKernel, Arg.Index, Arg.Size, ZeHandlePtr));
@@ -826,10 +826,10 @@ ur_result_t urCommandBufferAppendMemBufferCopyExp(
826826

827827
char *ZeHandleSrc;
828828
UR_CALL(SrcBuffer->getZeHandle(ZeHandleSrc, ur_mem_handle_t_::read_only,
829-
CommandBuffer->Device));
829+
CommandBuffer->Device, nullptr, 0u));
830830
char *ZeHandleDst;
831831
UR_CALL(DstBuffer->getZeHandle(ZeHandleDst, ur_mem_handle_t_::write_only,
832-
CommandBuffer->Device));
832+
CommandBuffer->Device, nullptr, 0u));
833833

834834
bool PreferCopyEngine = (SrcBuffer->OnHost || DstBuffer->OnHost);
835835

@@ -858,10 +858,10 @@ ur_result_t urCommandBufferAppendMemBufferCopyRectExp(
858858

859859
char *ZeHandleSrc;
860860
UR_CALL(SrcBuffer->getZeHandle(ZeHandleSrc, ur_mem_handle_t_::read_only,
861-
CommandBuffer->Device));
861+
CommandBuffer->Device, nullptr, 0u));
862862
char *ZeHandleDst;
863863
UR_CALL(DstBuffer->getZeHandle(ZeHandleDst, ur_mem_handle_t_::write_only,
864-
CommandBuffer->Device));
864+
CommandBuffer->Device, nullptr, 0u));
865865

866866
bool PreferCopyEngine = (SrcBuffer->OnHost || DstBuffer->OnHost);
867867

@@ -884,7 +884,7 @@ ur_result_t urCommandBufferAppendMemBufferWriteExp(
884884

885885
char *ZeHandleDst = nullptr;
886886
UR_CALL(Buffer->getZeHandle(ZeHandleDst, ur_mem_handle_t_::write_only,
887-
CommandBuffer->Device));
887+
CommandBuffer->Device, nullptr, 0u));
888888
// Always prefer copy engine for writes
889889
bool PreferCopyEngine = true;
890890

@@ -908,7 +908,7 @@ ur_result_t urCommandBufferAppendMemBufferWriteRectExp(
908908

909909
char *ZeHandleDst = nullptr;
910910
UR_CALL(Buffer->getZeHandle(ZeHandleDst, ur_mem_handle_t_::write_only,
911-
CommandBuffer->Device));
911+
CommandBuffer->Device, nullptr, 0u));
912912

913913
// Always prefer copy engine for writes
914914
bool PreferCopyEngine = true;
@@ -930,7 +930,7 @@ ur_result_t urCommandBufferAppendMemBufferReadExp(
930930

931931
char *ZeHandleSrc = nullptr;
932932
UR_CALL(Buffer->getZeHandle(ZeHandleSrc, ur_mem_handle_t_::read_only,
933-
CommandBuffer->Device));
933+
CommandBuffer->Device, nullptr, 0u));
934934

935935
// Always prefer copy engine for reads
936936
bool PreferCopyEngine = true;
@@ -953,7 +953,7 @@ ur_result_t urCommandBufferAppendMemBufferReadRectExp(
953953

954954
char *ZeHandleSrc;
955955
UR_CALL(Buffer->getZeHandle(ZeHandleSrc, ur_mem_handle_t_::read_only,
956-
CommandBuffer->Device));
956+
CommandBuffer->Device, nullptr, 0u));
957957

958958
// Always prefer copy engine for reads
959959
bool PreferCopyEngine = true;
@@ -1078,7 +1078,7 @@ ur_result_t urCommandBufferAppendMemBufferFillExp(
10781078
char *ZeHandleDst = nullptr;
10791079
_ur_buffer *UrBuffer = reinterpret_cast<_ur_buffer *>(Buffer);
10801080
UR_CALL(UrBuffer->getZeHandle(ZeHandleDst, ur_mem_handle_t_::write_only,
1081-
CommandBuffer->Device));
1081+
CommandBuffer->Device, nullptr, 0u));
10821082

10831083
return enqueueCommandBufferFillHelper(
10841084
UR_COMMAND_MEM_BUFFER_FILL, CommandBuffer, ZeHandleDst + Offset,
@@ -1512,7 +1512,7 @@ ur_result_t updateKernelCommand(
15121512
char **ZeHandlePtr = nullptr;
15131513
if (NewMemObjArg) {
15141514
UR_CALL(NewMemObjArg->getZeHandlePtr(ZeHandlePtr, UrAccessMode,
1515-
CommandBuffer->Device));
1515+
CommandBuffer->Device, nullptr, 0u));
15161516
}
15171517

15181518
auto ZeMutableArgDesc =

source/adapters/level_zero/kernel.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ ur_result_t urEnqueueKernelLaunch(
113113
char **ZeHandlePtr = nullptr;
114114
if (Arg.Value) {
115115
UR_CALL(Arg.Value->getZeHandlePtr(ZeHandlePtr, Arg.AccessMode,
116-
Queue->Device));
116+
Queue->Device, EventWaitList,
117+
NumEventsInWaitList));
117118
}
118119
ZE2UR_CALL(zeKernelSetArgumentValue,
119120
(ZeKernel, Arg.Index, Arg.Size, ZeHandlePtr));
@@ -273,7 +274,8 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp(
273274
char **ZeHandlePtr = nullptr;
274275
if (Arg.Value) {
275276
UR_CALL(Arg.Value->getZeHandlePtr(ZeHandlePtr, Arg.AccessMode,
276-
Queue->Device));
277+
Queue->Device, EventWaitList,
278+
NumEventsInWaitList));
277279
}
278280
ZE2UR_CALL(zeKernelSetArgumentValue,
279281
(ZeKernel, Arg.Index, Arg.Size, ZeHandlePtr));

0 commit comments

Comments
 (0)