Skip to content

Commit 80b7ed8

Browse files
authored
Merge branch 'main' into iault/python3.12
2 parents fce96ae + 7907998 commit 80b7ed8

29 files changed

+1046
-364
lines changed

.github/workflows/e2e_level_zero.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
config: ""
2222
unit: "gpu"
2323
# Failing tests
24-
xfail: "InvokeSimd/Regression/call_vadd_1d_spill.cpp;InvokeSimd/Regression/ImplicitSubgroup/call_vadd_1d_spill.cpp;DeviceCodeSplit/grf.cpp;ESIMD/mask_expand_load.cpp;KernelAndProgram/target_register_alloc_mode.cpp;Matrix/joint_matrix_prefetch.cpp;ESIMD/mask_expand_load.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_prefetch.cpp;Matrix/joint_matrix_bf16_fill_k_cache_prefetch.cpp;Matrix/SPVCooperativeMatrix/element_wise_ops.cpp;"
24+
xfail: "InvokeSimd/Regression/call_vadd_1d_spill.cpp;InvokeSimd/Regression/ImplicitSubgroup/call_vadd_1d_spill.cpp;ESIMD/mask_expand_load.cpp;Matrix/joint_matrix_prefetch.cpp;ESIMD/mask_expand_load.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_prefetch.cpp;Matrix/joint_matrix_bf16_fill_k_cache_prefetch.cpp;Matrix/SPVCooperativeMatrix/element_wise_ops.cpp;"
2525
# Unexpectedly Passed Tests
2626
xfail_not: ""
2727
# Flaky tests

cmake/FetchLevelZero.cmake

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See LICENSE.TXT
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
set(UR_LEVEL_ZERO_LOADER_LIBRARY "" CACHE FILEPATH "Path of the Level Zero Loader library")
7+
set(UR_LEVEL_ZERO_INCLUDE_DIR "" CACHE FILEPATH "Directory containing the Level Zero Headers")
8+
set(UR_LEVEL_ZERO_LOADER_REPO "" CACHE STRING "Github repo to get the Level Zero loader sources from")
9+
set(UR_LEVEL_ZERO_LOADER_TAG "" CACHE STRING " GIT tag of the Level Loader taken from github repo")
10+
11+
# Copy Level Zero loader/headers locally to the build to avoid leaking their path.
12+
set(LEVEL_ZERO_COPY_DIR ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader)
13+
if (NOT UR_LEVEL_ZERO_LOADER_LIBRARY STREQUAL "")
14+
get_filename_component(LEVEL_ZERO_LIB_NAME "${UR_LEVEL_ZERO_LOADER_LIBRARY}" NAME)
15+
set(LEVEL_ZERO_LIBRARY ${LEVEL_ZERO_COPY_DIR}/${LEVEL_ZERO_LIB_NAME})
16+
message(STATUS "Level Zero Adapter: Copying Level Zero loader to local build tree")
17+
file(COPY ${UR_LEVEL_ZERO_LOADER_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN)
18+
endif()
19+
if (NOT UR_LEVEL_ZERO_INCLUDE_DIR STREQUAL "")
20+
set(LEVEL_ZERO_INCLUDE_DIR ${LEVEL_ZERO_COPY_DIR})
21+
message(STATUS "Level Zero Adapter: Copying Level Zero headers to local build tree")
22+
file(COPY ${UR_LEVEL_ZERO_INCLUDE_DIR}/ DESTINATION ${LEVEL_ZERO_COPY_DIR})
23+
endif()
24+
25+
if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
26+
message(STATUS "Level Zero Adapter: Download Level Zero loader and headers from github.com")
27+
28+
# Workaround warnings/errors for Level Zero build
29+
set(CMAKE_CXX_FLAGS_BAK "${CMAKE_CXX_FLAGS}")
30+
if (UNIX)
31+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
32+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic")
33+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-stringop-truncation")
34+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
35+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-extra-semi")
36+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
37+
endif()
38+
39+
if (UR_LEVEL_ZERO_LOADER_REPO STREQUAL "")
40+
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
41+
endif()
42+
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
43+
set(UR_LEVEL_ZERO_LOADER_TAG v1.17.39)
44+
endif()
45+
46+
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
47+
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
48+
# Prevent L0 loader from exporting extra symbols
49+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
50+
51+
message(STATUS "Level Zero Adapter: Will fetch Level Zero Loader from ${UR_LEVEL_ZERO_LOADER_REPO}")
52+
include(FetchContent)
53+
FetchContent_Declare(level-zero-loader
54+
GIT_REPOSITORY ${UR_LEVEL_ZERO_LOADER_REPO}
55+
GIT_TAG ${UR_LEVEL_ZERO_LOADER_TAG}
56+
)
57+
if(MSVC)
58+
set(USE_Z7 ON)
59+
endif()
60+
FetchContent_MakeAvailable(level-zero-loader)
61+
FetchContent_GetProperties(level-zero-loader)
62+
63+
# Restore original flags
64+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK}")
65+
66+
target_compile_options(ze_loader PRIVATE
67+
$<$<IN_LIST:$<CXX_COMPILER_ID>,GNU;Clang;Intel;IntelLLVM>:-Wno-error>
68+
$<$<CXX_COMPILER_ID:MSVC>:/WX- /UUNICODE>
69+
)
70+
71+
set(LEVEL_ZERO_LIBRARY ze_loader)
72+
set(LEVEL_ZERO_INCLUDE_DIR
73+
${level-zero-loader_SOURCE_DIR}/include CACHE PATH "Path to Level Zero Headers")
74+
endif()
75+
76+
add_library(LevelZeroLoader INTERFACE)
77+
# The MSVC linker does not like / at the start of a path, so to work around this
78+
# we split it into a link library and a library path, where the path is allowed
79+
# to have leading /.
80+
get_filename_component(LEVEL_ZERO_LIBRARY_SRC "${LEVEL_ZERO_LIBRARY}" DIRECTORY)
81+
get_filename_component(LEVEL_ZERO_LIB_NAME "${LEVEL_ZERO_LIBRARY}" NAME)
82+
target_link_directories(LevelZeroLoader
83+
INTERFACE "$<BUILD_INTERFACE:${LEVEL_ZERO_LIBRARY_SRC}>"
84+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
85+
)
86+
target_link_libraries(LevelZeroLoader
87+
INTERFACE "${LEVEL_ZERO_LIB_NAME}"
88+
)
89+
90+
add_library(LevelZeroLoader-Headers INTERFACE)
91+
target_include_directories(LevelZeroLoader-Headers
92+
INTERFACE "$<BUILD_INTERFACE:${LEVEL_ZERO_INCLUDE_DIR}>"
93+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
94+
)

source/adapters/level_zero/CMakeLists.txt

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -3,96 +3,6 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
set(UR_LEVEL_ZERO_LOADER_LIBRARY "" CACHE FILEPATH "Path of the Level Zero Loader library")
7-
set(UR_LEVEL_ZERO_INCLUDE_DIR "" CACHE FILEPATH "Directory containing the Level Zero Headers")
8-
set(UR_LEVEL_ZERO_LOADER_REPO "" CACHE STRING "Github repo to get the Level Zero loader sources from")
9-
set(UR_LEVEL_ZERO_LOADER_TAG "" CACHE STRING " GIT tag of the Level Loader taken from github repo")
10-
11-
# Copy Level Zero loader/headers locally to the build to avoid leaking their path.
12-
set(LEVEL_ZERO_COPY_DIR ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader)
13-
if (NOT UR_LEVEL_ZERO_LOADER_LIBRARY STREQUAL "")
14-
get_filename_component(LEVEL_ZERO_LIB_NAME "${UR_LEVEL_ZERO_LOADER_LIBRARY}" NAME)
15-
set(LEVEL_ZERO_LIBRARY ${LEVEL_ZERO_COPY_DIR}/${LEVEL_ZERO_LIB_NAME})
16-
message(STATUS "Level Zero Adapter: Copying Level Zero loader to local build tree")
17-
file(COPY ${UR_LEVEL_ZERO_LOADER_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN)
18-
endif()
19-
if (NOT UR_LEVEL_ZERO_INCLUDE_DIR STREQUAL "")
20-
set(LEVEL_ZERO_INCLUDE_DIR ${LEVEL_ZERO_COPY_DIR})
21-
message(STATUS "Level Zero Adapter: Copying Level Zero headers to local build tree")
22-
file(COPY ${UR_LEVEL_ZERO_INCLUDE_DIR}/ DESTINATION ${LEVEL_ZERO_COPY_DIR})
23-
endif()
24-
25-
if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
26-
message(STATUS "Level Zero Adapter: Download Level Zero loader and headers from github.com")
27-
28-
# Workaround warnings/errors for Level Zero build
29-
set(CMAKE_CXX_FLAGS_BAK "${CMAKE_CXX_FLAGS}")
30-
if (UNIX)
31-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
32-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic")
33-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-stringop-truncation")
34-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
35-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-extra-semi")
36-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
37-
endif()
38-
39-
if (UR_LEVEL_ZERO_LOADER_REPO STREQUAL "")
40-
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
41-
endif()
42-
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
43-
set(UR_LEVEL_ZERO_LOADER_TAG v1.17.39)
44-
endif()
45-
46-
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
47-
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
48-
# Prevent L0 loader from exporting extra symbols
49-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
50-
51-
message(STATUS "Level Zero Adapter: Will fetch Level Zero Loader from ${UR_LEVEL_ZERO_LOADER_REPO}")
52-
include(FetchContent)
53-
FetchContent_Declare(level-zero-loader
54-
GIT_REPOSITORY ${UR_LEVEL_ZERO_LOADER_REPO}
55-
GIT_TAG ${UR_LEVEL_ZERO_LOADER_TAG}
56-
)
57-
if(MSVC)
58-
set(USE_Z7 ON)
59-
endif()
60-
FetchContent_MakeAvailable(level-zero-loader)
61-
FetchContent_GetProperties(level-zero-loader)
62-
63-
# Restore original flags
64-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK}")
65-
66-
target_compile_options(ze_loader PRIVATE
67-
$<$<IN_LIST:$<CXX_COMPILER_ID>,GNU;Clang;Intel;IntelLLVM>:-Wno-error>
68-
$<$<CXX_COMPILER_ID:MSVC>:/WX- /UUNICODE>
69-
)
70-
71-
set(LEVEL_ZERO_LIBRARY ze_loader)
72-
set(LEVEL_ZERO_INCLUDE_DIR
73-
${level-zero-loader_SOURCE_DIR}/include CACHE PATH "Path to Level Zero Headers")
74-
endif()
75-
76-
add_library(LevelZeroLoader INTERFACE)
77-
# The MSVC linker does not like / at the start of a path, so to work around this
78-
# we split it into a link library and a library path, where the path is allowed
79-
# to have leading /.
80-
get_filename_component(LEVEL_ZERO_LIBRARY_SRC "${LEVEL_ZERO_LIBRARY}" DIRECTORY)
81-
get_filename_component(LEVEL_ZERO_LIB_NAME "${LEVEL_ZERO_LIBRARY}" NAME)
82-
target_link_directories(LevelZeroLoader
83-
INTERFACE "$<BUILD_INTERFACE:${LEVEL_ZERO_LIBRARY_SRC}>"
84-
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
85-
)
86-
target_link_libraries(LevelZeroLoader
87-
INTERFACE "${LEVEL_ZERO_LIB_NAME}"
88-
)
89-
90-
add_library(LevelZeroLoader-Headers INTERFACE)
91-
target_include_directories(LevelZeroLoader-Headers
92-
INTERFACE "$<BUILD_INTERFACE:${LEVEL_ZERO_INCLUDE_DIR}>"
93-
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
94-
)
95-
966
if(UR_BUILD_ADAPTER_L0)
977
set(ADAPTER_LIB_TYPE SHARED)
988
if(UR_STATIC_ADAPTER_L0)

source/adapters/level_zero/memory.cpp

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,19 +2045,30 @@ ur_result_t _ur_buffer::getZeHandle(char *&ZeHandle, access_mode_t AccessMode,
20452045

20462046
auto &Allocation = Allocations[Device];
20472047

2048+
if (this->isFreed) {
2049+
die("getZeHandle() buffer already released, no valid handles.");
2050+
}
2051+
20482052
// Sub-buffers don't maintain own allocations but rely on parent buffer.
20492053
if (SubBuffer) {
2050-
UR_CALL(SubBuffer->Parent->getZeHandle(ZeHandle, AccessMode, Device,
2051-
phWaitEvents, numWaitEvents));
2052-
ZeHandle += SubBuffer->Origin;
2053-
// Still store the allocation info in the PI sub-buffer for
2054-
// getZeHandlePtr to work. At least zeKernelSetArgumentValue needs to
2055-
// be given a pointer to the allocation handle rather than its value.
2056-
//
2057-
Allocation.ZeHandle = ZeHandle;
2058-
Allocation.ReleaseAction = allocation_t::keep;
2059-
LastDeviceWithValidAllocation = Device;
2060-
return UR_RESULT_SUCCESS;
2054+
// Verify that the Parent Buffer is still valid or if it has been freed.
2055+
if (SubBuffer->Parent && !SubBuffer->Parent->isFreed) {
2056+
UR_CALL(SubBuffer->Parent->getZeHandle(ZeHandle, AccessMode, Device,
2057+
phWaitEvents, numWaitEvents));
2058+
ZeHandle += SubBuffer->Origin;
2059+
// Still store the allocation info in the PI sub-buffer for
2060+
// getZeHandlePtr to work. At least zeKernelSetArgumentValue needs to
2061+
// be given a pointer to the allocation handle rather than its value.
2062+
//
2063+
Allocation.ZeHandle = ZeHandle;
2064+
Allocation.ReleaseAction = allocation_t::keep;
2065+
LastDeviceWithValidAllocation = Device;
2066+
return UR_RESULT_SUCCESS;
2067+
} else {
2068+
// Return an error if the parent buffer is already gone.
2069+
die("getZeHandle() SubBuffer's parent already released, no valid "
2070+
"handles.");
2071+
}
20612072
}
20622073

20632074
// First handle case where the buffer is represented by only
@@ -2320,6 +2331,7 @@ ur_result_t _ur_buffer::free() {
23202331
die("_ur_buffer::free(): Unhandled release action");
23212332
}
23222333
ZeHandle = nullptr; // don't leave hanging pointers
2334+
this->isFreed = true;
23232335
}
23242336
return UR_RESULT_SUCCESS;
23252337
}

source/adapters/level_zero/memory.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ struct _ur_buffer final : ur_mem_handle_t_ {
108108
// Sub-buffer constructor
109109
_ur_buffer(_ur_buffer *Parent, size_t Origin, size_t Size)
110110
: ur_mem_handle_t_(Parent->UrContext),
111-
Size(Size), SubBuffer{{Parent, Origin}} {}
111+
Size(Size), SubBuffer{{Parent, Origin}} {
112+
// Retain the Parent Buffer due to the Creation of the SubBuffer.
113+
Parent->RefCount.increment();
114+
}
112115

113116
// Interop-buffer constructor
114117
_ur_buffer(ur_context_handle_t Context, size_t Size,
@@ -136,6 +139,9 @@ struct _ur_buffer final : ur_mem_handle_t_ {
136139
// Frees all allocations made for the buffer.
137140
ur_result_t free();
138141

142+
// Tracks if this buffer is freed already or should be considered valid.
143+
bool isFreed{false};
144+
139145
// Information about a single allocation representing this buffer.
140146
struct allocation_t {
141147
// Level Zero memory handle is really just a naked pointer.

source/adapters/level_zero/v2/context.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ ur_context_handle_t_::ur_context_handle_t_(ze_context_handle_t hContext,
2727
return std::make_unique<v2::provider_normal>(
2828
context, device, v2::EVENT_COUNTER,
2929
v2::QUEUE_IMMEDIATE);
30-
}) {}
30+
}),
31+
defaultUSMPool(this, nullptr) {}
3132

3233
ur_result_t ur_context_handle_t_::retain() {
3334
RefCount.increment();
@@ -60,6 +61,10 @@ bool ur_context_handle_t_::isValidDevice(ur_device_handle_t hDevice) const {
6061
return false;
6162
}
6263

64+
ur_usm_pool_handle_t ur_context_handle_t_::getDefaultUSMPool() {
65+
return &defaultUSMPool;
66+
}
67+
6368
namespace ur::level_zero {
6469
ur_result_t urContextCreate(uint32_t deviceCount,
6570
const ur_device_handle_t *phDevices,

source/adapters/level_zero/v2/context.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "command_list_cache.hpp"
1616
#include "common.hpp"
1717
#include "event_pool_cache.hpp"
18+
#include "usm.hpp"
1819

1920
struct ur_context_handle_t_ : _ur_object {
2021
ur_context_handle_t_(ze_context_handle_t hContext, uint32_t numDevices,
@@ -26,6 +27,7 @@ struct ur_context_handle_t_ : _ur_object {
2627
inline ze_context_handle_t getZeHandle() const { return hContext.get(); }
2728
ur_platform_handle_t getPlatform() const;
2829
const std::vector<ur_device_handle_t> &getDevices() const;
30+
ur_usm_pool_handle_t getDefaultUSMPool();
2931

3032
// Checks if Device is covered by this context.
3133
// For that the Device or its root devices need to be in the context.
@@ -35,4 +37,5 @@ struct ur_context_handle_t_ : _ur_object {
3537
const std::vector<ur_device_handle_t> hDevices;
3638
v2::command_list_cache_t commandListCache;
3739
v2::event_pool_cache eventPoolCache;
40+
ur_usm_pool_handle_t_ defaultUSMPool;
3841
};

source/adapters/level_zero/v2/queue_immediate_in_order.cpp

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -545,24 +545,61 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueUSMPrefetch(
545545
const void *pMem, size_t size, ur_usm_migration_flags_t flags,
546546
uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
547547
ur_event_handle_t *phEvent) {
548-
std::ignore = pMem;
549-
std::ignore = size;
550548
std::ignore = flags;
551-
std::ignore = numEventsInWaitList;
552-
std::ignore = phEventWaitList;
553-
std::ignore = phEvent;
554-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
549+
550+
std::scoped_lock<ur_shared_mutex> Lock(this->Mutex);
551+
552+
auto handler = getCommandListHandlerForCompute();
553+
auto signalEvent = getSignalEvent(handler, phEvent);
554+
555+
auto [pWaitEvents, numWaitEvents] =
556+
getWaitListView(phEventWaitList, numEventsInWaitList, handler);
557+
558+
if (pWaitEvents) {
559+
ZE2UR_CALL(zeCommandListAppendBarrier, (handler->commandList.get(), nullptr,
560+
numWaitEvents, pWaitEvents));
561+
}
562+
// TODO: figure out how to translate "flags"
563+
ZE2UR_CALL(zeCommandListAppendMemoryPrefetch,
564+
(handler->commandList.get(), pMem, size));
565+
ZE2UR_CALL(zeCommandListAppendSignalEvent,
566+
(handler->commandList.get(), signalEvent));
567+
568+
lastHandler = handler;
569+
570+
return UR_RESULT_SUCCESS;
555571
}
556572

557573
ur_result_t
558574
ur_queue_immediate_in_order_t::enqueueUSMAdvise(const void *pMem, size_t size,
559575
ur_usm_advice_flags_t advice,
560576
ur_event_handle_t *phEvent) {
561-
std::ignore = pMem;
562-
std::ignore = size;
563-
std::ignore = advice;
564-
std::ignore = phEvent;
565-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
577+
std::ignore = flags;
578+
579+
auto zeAdvice = ur_cast<ze_memory_advice_t>(advice);
580+
581+
std::scoped_lock<ur_shared_mutex> Lock(this->Mutex);
582+
583+
auto handler = getCommandListHandlerForCompute();
584+
auto signalEvent = getSignalEvent(handler, phEvent);
585+
586+
auto [pWaitEvents, numWaitEvents] = getWaitListView(nullptr, 0, handler);
587+
588+
if (pWaitEvents) {
589+
ZE2UR_CALL(zeCommandListAppendBarrier, (handler->commandList.get(), nullptr,
590+
numWaitEvents, pWaitEvents));
591+
}
592+
593+
// TODO: figure out how to translate "flags"
594+
ZE2UR_CALL(zeCommandListAppendMemAdvise,
595+
(handler->commandList.get(), this->hDevice->ZeDevice, pMem, size,
596+
zeAdvice));
597+
ZE2UR_CALL(zeCommandListAppendSignalEvent,
598+
(handler->commandList.get(), signalEvent));
599+
600+
lastHandler = handler;
601+
602+
return UR_RESULT_SUCCESS;
566603
}
567604

568605
ur_result_t ur_queue_immediate_in_order_t::enqueueUSMFill2D(

0 commit comments

Comments
 (0)