2019-08-28 13:12:44 +02:00
|
|
|
/*
|
2023-02-01 16:23:01 +00:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-08-28 13:12:44 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/device/sub_device.h"
|
2019-08-28 13:12:44 +02:00
|
|
|
|
2021-04-26 15:19:31 +00:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/device/root_device.h"
|
2023-02-01 16:23:01 +00:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2019-08-28 13:12:44 +02:00
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
2021-04-22 14:28:27 +00:00
|
|
|
SubDevice::SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, Device &rootDevice)
|
2021-12-16 11:08:32 +00:00
|
|
|
: Device(executionEnvironment, rootDevice.getRootDeviceIndex()), rootDevice(static_cast<RootDevice &>(rootDevice)), subDeviceIndex(subDeviceIndex) {
|
2021-04-22 14:28:27 +00:00
|
|
|
UNRECOVERABLE_IF(rootDevice.isSubDevice());
|
2021-04-07 17:00:33 +00:00
|
|
|
deviceBitfield = 0;
|
|
|
|
|
deviceBitfield.set(subDeviceIndex);
|
2020-02-06 13:33:30 +01:00
|
|
|
}
|
|
|
|
|
|
2021-04-23 10:56:13 +00:00
|
|
|
SubDevice::SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, Device &rootDevice, aub_stream::EngineType engineType)
|
|
|
|
|
: SubDevice(executionEnvironment, subDeviceIndex, rootDevice) {
|
2021-05-06 11:33:39 +00:00
|
|
|
this->engineInstancedType = engineType;
|
2021-04-23 10:56:13 +00:00
|
|
|
engineInstanced = true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-02 16:38:42 +02:00
|
|
|
void SubDevice::incRefInternal() {
|
|
|
|
|
rootDevice.incRefInternal();
|
|
|
|
|
}
|
|
|
|
|
unique_ptr_if_unused<Device> SubDevice::decRefInternal() {
|
|
|
|
|
return rootDevice.decRefInternal();
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-05 11:25:26 +01:00
|
|
|
uint32_t SubDevice::getSubDeviceIndex() const {
|
|
|
|
|
return subDeviceIndex;
|
|
|
|
|
}
|
2020-02-06 13:33:30 +01:00
|
|
|
|
2021-04-07 17:00:33 +00:00
|
|
|
Device *SubDevice::getRootDevice() const {
|
2020-07-15 12:38:34 +02:00
|
|
|
return &rootDevice;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-28 13:12:44 +02:00
|
|
|
} // namespace NEO
|