feature: L0 Device Hierarchy support for Composite & Flat modes

Related-To: LOCI-4615

- Added Support for users to set ZE_FLAT_DEVICE_HIERARCHY to either FLAT
or COMPOSITE to change how devices are returned in zeDeviceGet and
clGetDeviceIDs.
- COMPOSITE is default behavior that exists today.
- FLAT returns all sub devices which have no sub devices and all root
devices that have no sub devices in zeDeviceGet ie with all devices
flattened out in order.
- Added zeDeviceGetRootDevice for one to retrieve the Root Device for
any SubDevice.

Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
This commit is contained in:
Neil R Spruit
2023-07-12 02:14:09 +00:00
committed by Compute-Runtime-Automation
parent 5b80bd4d7c
commit 8efd8853fb
19 changed files with 403 additions and 2 deletions

View File

@@ -262,6 +262,10 @@ cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform,
exposeSubDevices = DebugManager.flags.ReturnSubDevicesAsApiDevices.get();
}
if (pPlatform->peekExecutionEnvironment()->isExposingSubDevicesAsDevices()) {
exposeSubDevices = true;
}
ClDevice *device = pPlatform->getClDevice(platformDeviceIndex);
UNRECOVERABLE_IF(device == nullptr);