mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Add sub-devices to the list of devices in a context
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e35ffb0601
commit
b05be25349
@@ -42,6 +42,14 @@ ContextImp::ContextImp(DriverHandle *driverHandle) {
|
||||
this->driverHandle = static_cast<DriverHandleImp *>(driverHandle);
|
||||
}
|
||||
|
||||
void ContextImp::addDeviceAndSubDevices(Device *device) {
|
||||
this->devices.insert(std::make_pair(device->toHandle(), device));
|
||||
DeviceImp *deviceImp = static_cast<DeviceImp *>(device);
|
||||
for (auto subDevice : deviceImp->subDevices) {
|
||||
this->addDeviceAndSubDevices(subDevice);
|
||||
}
|
||||
}
|
||||
|
||||
ze_result_t ContextImp::allocHostMem(const ze_host_mem_alloc_desc_t *hostDesc,
|
||||
size_t size,
|
||||
size_t alignment,
|
||||
|
||||
@@ -109,6 +109,8 @@ struct ContextImp : Context {
|
||||
const ze_image_desc_t *desc,
|
||||
ze_image_handle_t *phImage) override;
|
||||
|
||||
void addDeviceAndSubDevices(Device *device);
|
||||
|
||||
std::map<ze_device_handle_t, Device *> &getDevices() {
|
||||
return devices;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user