Skip to content
Merged
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
2 changes: 0 additions & 2 deletions source/adapters/level_zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ if(UR_BUILD_ADAPTER_L0)
${CMAKE_CURRENT_SOURCE_DIR}/physical_mem.hpp
${CMAKE_CURRENT_SOURCE_DIR}/platform.hpp
${CMAKE_CURRENT_SOURCE_DIR}/program.hpp
${CMAKE_CURRENT_SOURCE_DIR}/queue_api.hpp
${CMAKE_CURRENT_SOURCE_DIR}/queue.hpp
${CMAKE_CURRENT_SOURCE_DIR}/sampler.hpp
${CMAKE_CURRENT_SOURCE_DIR}/helpers/kernel_helpers.hpp
Expand All @@ -127,7 +126,6 @@ if(UR_BUILD_ADAPTER_L0)
${CMAKE_CURRENT_SOURCE_DIR}/physical_mem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/platform.cpp
${CMAKE_CURRENT_SOURCE_DIR}/program.cpp
${CMAKE_CURRENT_SOURCE_DIR}/queue_api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/queue.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sampler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image.cpp
Expand Down
10 changes: 4 additions & 6 deletions source/adapters/level_zero/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,7 @@ namespace {
* @param[out] ZeCommandQueue The L0 command queue.
* @return UR_RESULT_SUCCESS or an error code on failure
*/
ur_result_t getZeCommandQueue(ur_queue_handle_legacy_t Queue,
bool UseCopyEngine,
ur_result_t getZeCommandQueue(ur_queue_handle_t Queue, bool UseCopyEngine,
ze_command_queue_handle_t &ZeCommandQueue) {
auto &QGroup = Queue->getQueueGroup(UseCopyEngine);
uint32_t QueueGroupOrdinal;
Expand All @@ -1130,7 +1129,7 @@ ur_result_t getZeCommandQueue(ur_queue_handle_legacy_t Queue,
* @return UR_RESULT_SUCCESS or an error code on failure
*/
ur_result_t waitForDependencies(ur_exp_command_buffer_handle_t CommandBuffer,
ur_queue_handle_legacy_t Queue,
ur_queue_handle_t Queue,
uint32_t NumEventsInWaitList,
const ur_event_handle_t *EventWaitList) {
const bool UseCopyEngine = false;
Expand Down Expand Up @@ -1182,7 +1181,7 @@ ur_result_t waitForDependencies(ur_exp_command_buffer_handle_t CommandBuffer,
* @return UR_RESULT_SUCCESS or an error code on failure
*/
ur_result_t createUserEvent(ur_exp_command_buffer_handle_t CommandBuffer,
ur_queue_handle_legacy_t Queue,
ur_queue_handle_t Queue,
ur_command_list_ptr_t SignalCommandList,
ur_event_handle_t *Event) {
// Execution event for this enqueue of the UR command-buffer
Expand Down Expand Up @@ -1229,10 +1228,9 @@ ur_result_t createUserEvent(ur_exp_command_buffer_handle_t CommandBuffer,
} // namespace

UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
ur_exp_command_buffer_handle_t CommandBuffer, ur_queue_handle_t UrQueue,
ur_exp_command_buffer_handle_t CommandBuffer, ur_queue_handle_t Queue,
uint32_t NumEventsInWaitList, const ur_event_handle_t *EventWaitList,
ur_event_handle_t *Event) {
auto Queue = Legacy(UrQueue);
std::scoped_lock<ur_shared_mutex> Lock(Queue->Mutex);

ze_command_queue_handle_t ZeCommandQueue;
Expand Down
12 changes: 6 additions & 6 deletions source/adapters/level_zero/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
std::scoped_lock<ur_mutex> Lock(EventCacheMutex);
ur_device_handle_t Device = nullptr;

if (!Event->IsMultiDevice && Legacy(Event->UrQueue)) {
Device = Legacy(Event->UrQueue)->Device;
if (!Event->IsMultiDevice && Event->UrQueue) {
Device = Event->UrQueue->Device;
}

auto Cache = getEventCache(Event->isHostVisible(),
Expand All @@ -598,10 +598,10 @@ ur_context_handle_t_::decrementUnreleasedEventsInPool(ur_event_handle_t Event) {

ze_device_handle_t ZeDevice = nullptr;
bool UsingImmediateCommandlists =
!Legacy(Event->UrQueue) || Legacy(Event->UrQueue)->UsingImmCmdLists;
!Event->UrQueue || Event->UrQueue->UsingImmCmdLists;

if (!Event->IsMultiDevice && Legacy(Event->UrQueue)) {
ZeDevice = Legacy(Event->UrQueue)->Device->ZeDevice;
if (!Event->IsMultiDevice && Event->UrQueue) {
ZeDevice = Event->UrQueue->Device->ZeDevice;
}

std::list<ze_event_pool_handle_t> *ZePoolCache = getZeEventPoolCache(
Expand Down Expand Up @@ -644,7 +644,7 @@ static const size_t CmdListsCleanupThreshold = [] {

// Retrieve an available command list to be used in a PI call.
ur_result_t ur_context_handle_t_::getAvailableCommandList(
ur_queue_handle_legacy_t Queue, ur_command_list_ptr_t &CommandList,
ur_queue_handle_t Queue, ur_command_list_ptr_t &CommandList,
bool UseCopyEngine, uint32_t NumEventsInWaitList,
const ur_event_handle_t *EventWaitList, bool AllowBatching,
ze_command_queue_handle_t *ForcedCmdQueue) {
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/level_zero/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct ur_context_handle_t_ : _ur_object {
// for executing on this device. Immediate commandlists are created only
// once for each SYCL Queue and after that they are reused.
ur_result_t getAvailableCommandList(
ur_queue_handle_legacy_t Queue, ur_command_list_ptr_t &CommandList,
ur_queue_handle_t Queue, ur_command_list_ptr_t &CommandList,
bool UseCopyEngine, uint32_t NumEventsInWaitList,
const ur_event_handle_t *EventWaitList, bool AllowBatching = false,
ze_command_queue_handle_t *ForcedCmdQueue = nullptr);
Expand Down
23 changes: 18 additions & 5 deletions source/adapters/level_zero/enqueue_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,26 @@
//
//===----------------------------------------------------------------------===//

#include <tuple>
#include <ur_api.h>
#include <utility>

#include "queue.hpp"
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueNativeCommandExp(
ur_queue_handle_t hQueue,
ur_exp_enqueue_native_command_function_t pfnNativeEnqueue, void *data,
uint32_t numMemsInMemList, const ur_mem_handle_t *phMemList,
const ur_exp_enqueue_native_command_properties_t *pProperties,
uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
ur_event_handle_t *phEvent) {
std::ignore = hQueue;
std::ignore = pfnNativeEnqueue;
std::ignore = data;
std::ignore = numMemsInMemList;
std::ignore = phMemList;
std::ignore = pProperties;
std::ignore = numEventsInWaitList;
std::ignore = phEventWaitList;
std::ignore = phEvent;

ur_result_t ur_queue_handle_legacy_t_::enqueueNativeCommandExp(
ur_exp_enqueue_native_command_function_t, void *, uint32_t,
const ur_mem_handle_t *, const ur_exp_enqueue_native_command_properties_t *,
uint32_t, const ur_event_handle_t *, ur_event_handle_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Loading