Skip to content

Commit 197ffb8

Browse files
authored
Merge pull request #1919 from igchor/revert_queue_abstract_class
Revert queue abstract class
2 parents 6463cba + 40e7cd6 commit 197ffb8

File tree

15 files changed

+302
-1005
lines changed

15 files changed

+302
-1005
lines changed

source/adapters/level_zero/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ if(UR_BUILD_ADAPTER_L0)
109109
${CMAKE_CURRENT_SOURCE_DIR}/physical_mem.hpp
110110
${CMAKE_CURRENT_SOURCE_DIR}/platform.hpp
111111
${CMAKE_CURRENT_SOURCE_DIR}/program.hpp
112-
${CMAKE_CURRENT_SOURCE_DIR}/queue_api.hpp
113112
${CMAKE_CURRENT_SOURCE_DIR}/queue.hpp
114113
${CMAKE_CURRENT_SOURCE_DIR}/sampler.hpp
115114
${CMAKE_CURRENT_SOURCE_DIR}/helpers/kernel_helpers.hpp
@@ -127,7 +126,6 @@ if(UR_BUILD_ADAPTER_L0)
127126
${CMAKE_CURRENT_SOURCE_DIR}/physical_mem.cpp
128127
${CMAKE_CURRENT_SOURCE_DIR}/platform.cpp
129128
${CMAKE_CURRENT_SOURCE_DIR}/program.cpp
130-
${CMAKE_CURRENT_SOURCE_DIR}/queue_api.cpp
131129
${CMAKE_CURRENT_SOURCE_DIR}/queue.cpp
132130
${CMAKE_CURRENT_SOURCE_DIR}/sampler.cpp
133131
${CMAKE_CURRENT_SOURCE_DIR}/image.cpp

source/adapters/level_zero/command_buffer.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,7 @@ namespace {
11121112
* @param[out] ZeCommandQueue The L0 command queue.
11131113
* @return UR_RESULT_SUCCESS or an error code on failure
11141114
*/
1115-
ur_result_t getZeCommandQueue(ur_queue_handle_legacy_t Queue,
1116-
bool UseCopyEngine,
1115+
ur_result_t getZeCommandQueue(ur_queue_handle_t Queue, bool UseCopyEngine,
11171116
ze_command_queue_handle_t &ZeCommandQueue) {
11181117
auto &QGroup = Queue->getQueueGroup(UseCopyEngine);
11191118
uint32_t QueueGroupOrdinal;
@@ -1130,7 +1129,7 @@ ur_result_t getZeCommandQueue(ur_queue_handle_legacy_t Queue,
11301129
* @return UR_RESULT_SUCCESS or an error code on failure
11311130
*/
11321131
ur_result_t waitForDependencies(ur_exp_command_buffer_handle_t CommandBuffer,
1133-
ur_queue_handle_legacy_t Queue,
1132+
ur_queue_handle_t Queue,
11341133
uint32_t NumEventsInWaitList,
11351134
const ur_event_handle_t *EventWaitList) {
11361135
const bool UseCopyEngine = false;
@@ -1182,7 +1181,7 @@ ur_result_t waitForDependencies(ur_exp_command_buffer_handle_t CommandBuffer,
11821181
* @return UR_RESULT_SUCCESS or an error code on failure
11831182
*/
11841183
ur_result_t createUserEvent(ur_exp_command_buffer_handle_t CommandBuffer,
1185-
ur_queue_handle_legacy_t Queue,
1184+
ur_queue_handle_t Queue,
11861185
ur_command_list_ptr_t SignalCommandList,
11871186
ur_event_handle_t *Event) {
11881187
// Execution event for this enqueue of the UR command-buffer
@@ -1229,10 +1228,9 @@ ur_result_t createUserEvent(ur_exp_command_buffer_handle_t CommandBuffer,
12291228
} // namespace
12301229

12311230
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
1232-
ur_exp_command_buffer_handle_t CommandBuffer, ur_queue_handle_t UrQueue,
1231+
ur_exp_command_buffer_handle_t CommandBuffer, ur_queue_handle_t Queue,
12331232
uint32_t NumEventsInWaitList, const ur_event_handle_t *EventWaitList,
12341233
ur_event_handle_t *Event) {
1235-
auto Queue = Legacy(UrQueue);
12361234
std::scoped_lock<ur_shared_mutex> Lock(Queue->Mutex);
12371235

12381236
ze_command_queue_handle_t ZeCommandQueue;

source/adapters/level_zero/context.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
576576
std::scoped_lock<ur_mutex> Lock(EventCacheMutex);
577577
ur_device_handle_t Device = nullptr;
578578

579-
if (!Event->IsMultiDevice && Legacy(Event->UrQueue)) {
580-
Device = Legacy(Event->UrQueue)->Device;
579+
if (!Event->IsMultiDevice && Event->UrQueue) {
580+
Device = Event->UrQueue->Device;
581581
}
582582

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

599599
ze_device_handle_t ZeDevice = nullptr;
600600
bool UsingImmediateCommandlists =
601-
!Legacy(Event->UrQueue) || Legacy(Event->UrQueue)->UsingImmCmdLists;
601+
!Event->UrQueue || Event->UrQueue->UsingImmCmdLists;
602602

603-
if (!Event->IsMultiDevice && Legacy(Event->UrQueue)) {
604-
ZeDevice = Legacy(Event->UrQueue)->Device->ZeDevice;
603+
if (!Event->IsMultiDevice && Event->UrQueue) {
604+
ZeDevice = Event->UrQueue->Device->ZeDevice;
605605
}
606606

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

645645
// Retrieve an available command list to be used in a PI call.
646646
ur_result_t ur_context_handle_t_::getAvailableCommandList(
647-
ur_queue_handle_legacy_t Queue, ur_command_list_ptr_t &CommandList,
647+
ur_queue_handle_t Queue, ur_command_list_ptr_t &CommandList,
648648
bool UseCopyEngine, uint32_t NumEventsInWaitList,
649649
const ur_event_handle_t *EventWaitList, bool AllowBatching,
650650
ze_command_queue_handle_t *ForcedCmdQueue) {

source/adapters/level_zero/context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ struct ur_context_handle_t_ : _ur_object {
297297
// for executing on this device. Immediate commandlists are created only
298298
// once for each SYCL Queue and after that they are reused.
299299
ur_result_t getAvailableCommandList(
300-
ur_queue_handle_legacy_t Queue, ur_command_list_ptr_t &CommandList,
300+
ur_queue_handle_t Queue, ur_command_list_ptr_t &CommandList,
301301
bool UseCopyEngine, uint32_t NumEventsInWaitList,
302302
const ur_event_handle_t *EventWaitList, bool AllowBatching = false,
303303
ze_command_queue_handle_t *ForcedCmdQueue = nullptr);

source/adapters/level_zero/enqueue_native.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,26 @@
88
//
99
//===----------------------------------------------------------------------===//
1010

11+
#include <tuple>
1112
#include <ur_api.h>
13+
#include <utility>
1214

13-
#include "queue.hpp"
15+
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueNativeCommandExp(
16+
ur_queue_handle_t hQueue,
17+
ur_exp_enqueue_native_command_function_t pfnNativeEnqueue, void *data,
18+
uint32_t numMemsInMemList, const ur_mem_handle_t *phMemList,
19+
const ur_exp_enqueue_native_command_properties_t *pProperties,
20+
uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
21+
ur_event_handle_t *phEvent) {
22+
std::ignore = hQueue;
23+
std::ignore = pfnNativeEnqueue;
24+
std::ignore = data;
25+
std::ignore = numMemsInMemList;
26+
std::ignore = phMemList;
27+
std::ignore = pProperties;
28+
std::ignore = numEventsInWaitList;
29+
std::ignore = phEventWaitList;
30+
std::ignore = phEvent;
1431

15-
ur_result_t ur_queue_handle_legacy_t_::enqueueNativeCommandExp(
16-
ur_exp_enqueue_native_command_function_t, void *, uint32_t,
17-
const ur_mem_handle_t *, const ur_exp_enqueue_native_command_properties_t *,
18-
uint32_t, const ur_event_handle_t *, ur_event_handle_t *) {
1932
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
2033
}

0 commit comments

Comments
 (0)