mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 12:33:12 +08:00
Simplify Device classes
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a2cbb4f859
commit
9cf7651643
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -13,6 +13,8 @@ namespace NEO {
|
||||
|
||||
SubDevice::SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, RootDevice &rootDevice)
|
||||
: Device(executionEnvironment), subDeviceIndex(subDeviceIndex), rootDevice(rootDevice) {
|
||||
deviceBitfield = 0;
|
||||
deviceBitfield.set(subDeviceIndex);
|
||||
}
|
||||
|
||||
void SubDevice::incRefInternal() {
|
||||
@@ -22,14 +24,6 @@ unique_ptr_if_unused<Device> SubDevice::decRefInternal() {
|
||||
return rootDevice.decRefInternal();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -38,17 +32,9 @@ uint32_t SubDevice::getSubDeviceIndex() const {
|
||||
return subDeviceIndex;
|
||||
}
|
||||
|
||||
Device *SubDevice::getDeviceById(uint32_t deviceId) const {
|
||||
UNRECOVERABLE_IF(deviceId >= getNumAvailableDevices());
|
||||
return const_cast<SubDevice *>(this);
|
||||
}
|
||||
|
||||
Device *SubDevice::getParentDevice() const {
|
||||
Device *SubDevice::getRootDevice() const {
|
||||
return &rootDevice;
|
||||
}
|
||||
BindlessHeapsHelper *SubDevice::getBindlessHeapsHelper() const {
|
||||
return rootDevice.getBindlessHeapsHelper();
|
||||
}
|
||||
|
||||
uint64_t SubDevice::getGlobalMemorySize(uint32_t deviceBitfield) const {
|
||||
auto globalMemorySize = Device::getGlobalMemorySize(static_cast<uint32_t>(maxNBitValue(rootDevice.getNumSubDevices())));
|
||||
|
||||
Reference in New Issue
Block a user