mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Resolves: NEO-4362 Change-Id: I8f667ff4baa368d3504da0b3ffd2db39a4d00d68 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/device/sub_device.h"
|
|
|
|
#include "shared/source/device/root_device.h"
|
|
|
|
namespace NEO {
|
|
|
|
SubDevice::SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, RootDevice &rootDevice)
|
|
: Device(executionEnvironment), subDeviceIndex(subDeviceIndex), rootDevice(rootDevice) {
|
|
}
|
|
|
|
DeviceBitfield SubDevice::getDeviceBitfield() const {
|
|
DeviceBitfield deviceBitfield;
|
|
deviceBitfield.set(subDeviceIndex);
|
|
return deviceBitfield;
|
|
}
|
|
uint32_t SubDevice::getNumAvailableDevices() const {
|
|
return 1u;
|
|
}
|
|
uint32_t SubDevice::getRootDeviceIndex() const {
|
|
return this->rootDevice.getRootDeviceIndex();
|
|
}
|
|
|
|
uint32_t SubDevice::getSubDeviceIndex() const {
|
|
return subDeviceIndex;
|
|
}
|
|
|
|
Device *SubDevice::getDeviceById(uint32_t deviceId) const {
|
|
UNRECOVERABLE_IF(deviceId >= getNumAvailableDevices());
|
|
return const_cast<SubDevice *>(this);
|
|
}
|
|
|
|
DeviceInfo &SubDevice::getMutableDeviceInfo() {
|
|
return deviceInfo;
|
|
}
|
|
|
|
} // namespace NEO
|