From 4c1df78262897096b97d0f4c14214bb1471fe5f6 Mon Sep 17 00:00:00 2001 From: "Spruit, Neil R" Date: Thu, 18 Jan 2024 14:34:34 -0800 Subject: [PATCH] [L0] Remove Device Filtering with urProgramBuild Handling MultiDevice Signed-off-by: Spruit, Neil R --- source/adapters/level_zero/queue.cpp | 31 ++-------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/source/adapters/level_zero/queue.cpp b/source/adapters/level_zero/queue.cpp index f07e0df675..e25c58f848 100644 --- a/source/adapters/level_zero/queue.cpp +++ b/source/adapters/level_zero/queue.cpp @@ -281,35 +281,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate( ur_queue_handle_t *Queue ///< [out] pointer to handle of queue object created ) { - - // Make the Device appear as the first device in the context since this - // is where the urProgramBuild will only build the module to. Also, if - // the Device is a sub-device then see if there is a also its root-device - // in the context and make that go first instead (because sub-device can - // run code built for its root-device). - // - // TODO: this is all hacky and should be removed when we add support - // for building to all the devices in the context. - // - { // Lock context for thread-safe update - std::scoped_lock Lock(Context->Mutex); - UR_ASSERT(Context->isValidDevice(Device), UR_RESULT_ERROR_INVALID_DEVICE); - - auto MakeFirst = Context->Devices.begin(); - for (auto I = Context->Devices.begin(); I != Context->Devices.end(); ++I) { - if (*I == Device) { - MakeFirst = I; - if (!Device->RootDevice) - break; - // continue the search for possible root-device in the context - } else if (*I == Device->RootDevice) { - MakeFirst = I; - break; // stop the search - } - } - if (MakeFirst != Context->Devices.begin()) - std::iter_swap(MakeFirst, Context->Devices.begin()); - } ur_queue_flags_t Flags{}; if (Props) { Flags = Props->flags; @@ -328,6 +299,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate( } } + UR_ASSERT(Context->isValidDevice(Device), UR_RESULT_ERROR_INVALID_DEVICE); + // Create placeholder queues in the compute queue group. // Actual L0 queues will be created at first use. std::vector ZeComputeCommandQueues(