Skip to content

Commit

Permalink
[L0] Remove Device Filtering with urProgramBuild Handling MultiDevice
Browse files Browse the repository at this point in the history
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
  • Loading branch information
nrspruit committed Jan 18, 2024
1 parent 865f29a commit 4c1df78
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions source/adapters/level_zero/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ur_shared_mutex> 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;
Expand All @@ -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<ze_command_queue_handle_t> ZeComputeCommandQueues(
Expand Down

0 comments on commit 4c1df78

Please sign in to comment.