Skip to content

Commit 1b2cd5b

Browse files
committed
[L0] Remove Device Filtering with urProgramBuild Handling MultiDevice
Signed-off-by: Spruit, Neil R <[email protected]>
1 parent c2682e9 commit 1b2cd5b

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

source/adapters/level_zero/queue.cpp

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -281,35 +281,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate(
281281
ur_queue_handle_t
282282
*Queue ///< [out] pointer to handle of queue object created
283283
) {
284-
285-
// Make the Device appear as the first device in the context since this
286-
// is where the urProgramBuild will only build the module to. Also, if
287-
// the Device is a sub-device then see if there is a also its root-device
288-
// in the context and make that go first instead (because sub-device can
289-
// run code built for its root-device).
290-
//
291-
// TODO: this is all hacky and should be removed when we add support
292-
// for building to all the devices in the context.
293-
//
294-
{ // Lock context for thread-safe update
295-
std::scoped_lock<ur_shared_mutex> Lock(Context->Mutex);
296-
UR_ASSERT(Context->isValidDevice(Device), UR_RESULT_ERROR_INVALID_DEVICE);
297-
298-
auto MakeFirst = Context->Devices.begin();
299-
for (auto I = Context->Devices.begin(); I != Context->Devices.end(); ++I) {
300-
if (*I == Device) {
301-
MakeFirst = I;
302-
if (!Device->RootDevice)
303-
break;
304-
// continue the search for possible root-device in the context
305-
} else if (*I == Device->RootDevice) {
306-
MakeFirst = I;
307-
break; // stop the search
308-
}
309-
}
310-
if (MakeFirst != Context->Devices.begin())
311-
std::iter_swap(MakeFirst, Context->Devices.begin());
312-
}
313284
ur_queue_flags_t Flags{};
314285
if (Props) {
315286
Flags = Props->flags;
@@ -328,6 +299,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate(
328299
}
329300
}
330301

302+
UR_ASSERT(Context->isValidDevice(Device), UR_RESULT_ERROR_INVALID_DEVICE);
303+
331304
// Create placeholder queues in the compute queue group.
332305
// Actual L0 queues will be created at first use.
333306
std::vector<ze_command_queue_handle_t> ZeComputeCommandQueues(

0 commit comments

Comments
 (0)