@@ -281,35 +281,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate(
281
281
ur_queue_handle_t
282
282
*Queue // /< [out] pointer to handle of queue object created
283
283
) {
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
- }
313
284
ur_queue_flags_t Flags{};
314
285
if (Props) {
315
286
Flags = Props->flags ;
@@ -328,6 +299,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate(
328
299
}
329
300
}
330
301
302
+ UR_ASSERT (Context->isValidDevice (Device), UR_RESULT_ERROR_INVALID_DEVICE);
303
+
331
304
// Create placeholder queues in the compute queue group.
332
305
// Actual L0 queues will be created at first use.
333
306
std::vector<ze_command_queue_handle_t > ZeComputeCommandQueues (
0 commit comments