mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Engine instanced SubDevices [2/n]
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
b881e5f0fe
commit
4b300e80cb
@ -333,11 +333,17 @@ TEST(SubDevicesTest, givenDebugFlagSetAndSingleCcsWhenCreatingRootDeviceWithoutG
|
||||
EXPECT_FALSE(rootDevice->getDeviceById(0)->isSubDevice());
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, givenDebugFlagSetWhenCreatingRootDeviceWithGenericSubDevicesThenDontCreateEngineInstanced) {
|
||||
TEST(SubDevicesTest, givenDebugFlagSetWhenCreatingRootDeviceWithGenericSubDevicesAndSingleCcsThenDontCreateEngineInstanced) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EngineInstancedSubDevices.set(true);
|
||||
|
||||
UltDeviceFactory deviceFactory(1, 2);
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
|
||||
|
||||
UltDeviceFactory deviceFactory(1, 2, *executionEnvironment);
|
||||
|
||||
auto &rootDevice = deviceFactory.rootDevices[0];
|
||||
|
||||
@ -351,6 +357,44 @@ TEST(SubDevicesTest, givenDebugFlagSetWhenCreatingRootDeviceWithGenericSubDevice
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, givenDebugFlagSetWhenCreatingRootDeviceWithGenericSubDevicesThenCreateEngineInstanced) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EngineInstancedSubDevices.set(true);
|
||||
|
||||
uint32_t ccsCount = 2;
|
||||
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = ccsCount;
|
||||
|
||||
UltDeviceFactory deviceFactory(1, 2, *executionEnvironment);
|
||||
|
||||
auto &rootDevice = deviceFactory.rootDevices[0];
|
||||
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
auto subDevice = static_cast<MockSubDevice *>(rootDevice->getDeviceById(i));
|
||||
ASSERT_NE(nullptr, subDevice);
|
||||
|
||||
EXPECT_FALSE(subDevice->engineInstanced);
|
||||
EXPECT_EQ(ccsCount, subDevice->getNumAvailableDevices());
|
||||
EXPECT_EQ(aub_stream::EngineType::NUM_ENGINES, subDevice->engineType);
|
||||
|
||||
for (uint32_t j = 0; j < ccsCount; j++) {
|
||||
auto engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_CCS + j);
|
||||
auto engineSubDevice = static_cast<MockSubDevice *>(subDevice->getDeviceById(j));
|
||||
ASSERT_NE(nullptr, engineSubDevice);
|
||||
|
||||
EXPECT_TRUE(engineSubDevice->engineInstanced);
|
||||
EXPECT_EQ(1u, engineSubDevice->getNumAvailableDevices());
|
||||
EXPECT_EQ(engineType, engineSubDevice->engineType);
|
||||
EXPECT_EQ(subDevice->getSubDeviceIndex(), engineSubDevice->getSubDeviceIndex());
|
||||
EXPECT_EQ(subDevice->getDeviceBitfield(), engineSubDevice->getDeviceBitfield());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, whenInitializeRootCsrThenDirectSubmissionIsNotInitialized) {
|
||||
auto device = std::make_unique<MockDevice>();
|
||||
device->initializeRootCommandStreamReceiver();
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/device/sub_device.h"
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/device/root_device.h"
|
||||
|
||||
namespace NEO {
|
||||
@ -48,4 +49,13 @@ uint64_t SubDevice::getGlobalMemorySize(uint32_t deviceBitfield) const {
|
||||
return globalMemorySize / rootDevice.getNumAvailableDevices();
|
||||
}
|
||||
|
||||
bool SubDevice::engineInstancedSubDevicesAllowed() const {
|
||||
if (engineInstanced) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (DebugManager.flags.EngineInstancedSubDevices.get() &&
|
||||
(getHardwareInfo().gtSystemInfo.CCSInfo.NumberOfCCSEnabled > 1));
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -27,7 +27,7 @@ class SubDevice : public Device {
|
||||
protected:
|
||||
uint64_t getGlobalMemorySize(uint32_t deviceBitfield) const override;
|
||||
bool genericSubDevicesAllowed() override { return false; };
|
||||
bool engineInstancedSubDevicesAllowed() const override { return false; };
|
||||
bool engineInstancedSubDevicesAllowed() const override;
|
||||
|
||||
RootDevice &rootDevice;
|
||||
const uint32_t subDeviceIndex;
|
||||
|
Reference in New Issue
Block a user