From fca2159430cd0e018be55836a95c15e899092974 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Thu, 26 Oct 2023 15:04:39 +0200 Subject: [PATCH] Revert "fix: if device hierarchy is flat then getSubDevicesCount return 1u" This reverts commit cb0bb57f49f2f804c454c679e0be0401cbe5356a. Signed-off-by: Compute-Runtime-Validation --- level_zero/core/source/device/device_imp.cpp | 2 +- .../api/ras/linux/sysman_os_ras_imp_hbm.cpp | 2 +- .../sysman/source/linux/zes_os_sysman_imp.cpp | 2 +- .../source/windows/zes_os_sysman_imp.cpp | 2 +- level_zero/tools/source/sysman/sysman_imp.cpp | 3 +-- .../sysman/mocks/mock_sysman_device_info.h | 1 - .../fixtures/multicontext_aub_fixture.cpp | 2 +- opencl/test/unit_test/device/device_tests.cpp | 4 ++-- .../test/unit_test/linux/main_linux_dll.cpp | 6 +++--- shared/source/aub/aub_center.cpp | 6 ++---- shared/source/aub/aub_helper.cpp | 4 ++-- shared/source/aub/aub_helper.h | 2 +- .../aub_command_stream_receiver.cpp | 6 +++--- .../aub_command_stream_receiver.h | 2 +- .../aub_command_stream_receiver_hw_base.inl | 2 +- ...ver_simulated_common_hw_xehp_and_later.inl | 3 +-- .../command_stream_receiver_simulated_hw.h | 6 +++--- .../tbx_command_stream_receiver_hw.inl | 4 ++-- shared/source/device/device.cpp | 10 +++++----- shared/source/device/device_caps.cpp | 2 +- shared/source/dll/linux/drm_neo_create.cpp | 2 +- .../execution_environment.cpp | 6 +++--- .../root_device_environment.h | 4 +++- shared/source/helpers/gfx_core_helper.cpp | 4 ++-- shared/source/helpers/gfx_core_helper.h | 2 +- .../definitions/storage_info.cpp | 2 +- .../source/memory_manager/memory_manager.cpp | 5 ++--- .../os_agnostic_memory_manager.cpp | 2 +- .../os_interface/linux/drm_memory_manager.cpp | 2 +- .../drm_memory_operations_handler_bind.cpp | 4 +--- .../windows/wddm_memory_manager.cpp | 2 +- shared/test/common/libult/linux/drm_mock.cpp | 2 +- .../linux/device_command_stream_fixture.cpp | 3 +-- .../linux/drm_command_stream_fixture.h | 2 +- .../os_interface/linux/drm_neo_create.cpp | 2 +- .../test/unit_test/aub/aub_helper_tests.cpp | 20 +++++++++---------- .../aub_command_stream_receiver_2_tests.cpp | 2 +- ...d_stream_receiver_tests_xehp_and_later.cpp | 4 ++-- .../command_stream/aub_file_stream_tests.cpp | 8 ++++---- .../tbx_command_stream_tests.cpp | 4 ++-- .../execution_environment_tests.cpp | 4 ++-- ..._manager_allocate_in_device_pool_tests.cpp | 5 ++--- ...and_stream_xehp_and_later_prelim_tests.cpp | 4 ++-- 43 files changed, 79 insertions(+), 87 deletions(-) diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index af13a69d37..1821897267 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -1596,7 +1596,7 @@ void DeviceImp::setDebugSession(DebugSession *session) { } bool DeviceImp::toPhysicalSliceId(const NEO::TopologyMap &topologyMap, uint32_t &slice, uint32_t &subslice, uint32_t &deviceIndex) { auto hwInfo = neoDevice->getRootDeviceEnvironment().getHardwareInfo(); - uint32_t subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(neoDevice->getExecutionEnvironment()->isExposingSubDevicesAsDevices(), hwInfo); + uint32_t subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(hwInfo); auto deviceBitfield = neoDevice->getDeviceBitfield(); if (topologyMap.size() == subDeviceCount && !isSubdevice) { diff --git a/level_zero/sysman/source/api/ras/linux/sysman_os_ras_imp_hbm.cpp b/level_zero/sysman/source/api/ras/linux/sysman_os_ras_imp_hbm.cpp index de57b6de52..811af23636 100644 --- a/level_zero/sysman/source/api/ras/linux/sysman_os_ras_imp_hbm.cpp +++ b/level_zero/sysman/source/api/ras/linux/sysman_os_ras_imp_hbm.cpp @@ -29,7 +29,7 @@ ze_result_t LinuxRasSourceHbm::osRasGetState(zes_ras_state_t &state, ze_bool_t c return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } uint32_t subDeviceCount = 0; - subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(false, &pDevice->getHardwareInfo()); + subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(&pDevice->getHardwareInfo()); if (clear == true) { uint64_t errorCount = 0; ze_result_t result = pFwInterface->fwGetMemoryErrorCount(osRasErrorType, subDeviceCount, subdeviceId, errorCount); diff --git a/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp b/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp index 820efaf2eb..24094ca15e 100644 --- a/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp +++ b/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp @@ -58,7 +58,7 @@ ze_result_t LinuxSysmanImp::init() { } DEBUG_BREAK_IF(nullptr == pSysfsAccess); - subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(false, &pParentSysmanDeviceImp->getHardwareInfo()); + subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(&pParentSysmanDeviceImp->getHardwareInfo()); if (subDeviceCount == 1) { subDeviceCount = 0; } diff --git a/level_zero/sysman/source/windows/zes_os_sysman_imp.cpp b/level_zero/sysman/source/windows/zes_os_sysman_imp.cpp index 003d3d9e27..7d03c9608d 100644 --- a/level_zero/sysman/source/windows/zes_os_sysman_imp.cpp +++ b/level_zero/sysman/source/windows/zes_os_sysman_imp.cpp @@ -30,7 +30,7 @@ ze_result_t WddmSysmanImp::init() { pKmdSysManager = KmdSysManager::create(pWddm); UNRECOVERABLE_IF(nullptr == pKmdSysManager); - subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(false, &pParentSysmanDeviceImp->getHardwareInfo()); + subDeviceCount = NEO::GfxCoreHelper::getSubDevicesCount(&pParentSysmanDeviceImp->getHardwareInfo()); if (subDeviceCount == 1) { subDeviceCount = 0; } diff --git a/level_zero/tools/source/sysman/sysman_imp.cpp b/level_zero/tools/source/sysman/sysman_imp.cpp index 6604af3c97..3a26e0bd1f 100644 --- a/level_zero/tools/source/sysman/sysman_imp.cpp +++ b/level_zero/tools/source/sysman/sysman_imp.cpp @@ -8,7 +8,6 @@ #include "level_zero/tools/source/sysman/sysman_imp.h" #include "shared/source/device/sub_device.h" -#include "shared/source/execution_environment/execution_environment.h" #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" @@ -89,7 +88,7 @@ void SysmanDeviceImp::getSysmanDeviceInfo(zes_device_handle_t hDevice, uint32_t // Check for root device with 1 sub-device case if (!neoDevice->isSubDevice() && neoDevice->getDeviceBitfield().count() == 1) { subdeviceId = Math::log2(static_cast(neoDevice->getDeviceBitfield().to_ulong())); - if ((NEO::GfxCoreHelper::getSubDevicesCount(neoDevice->getExecutionEnvironment()->isExposingSubDevicesAsDevices(), &neoDevice->getHardwareInfo()) > 1) && useMultiArchEnabled) { + if ((NEO::GfxCoreHelper::getSubDevicesCount(&neoDevice->getHardwareInfo()) > 1) && useMultiArchEnabled) { onSubdevice = true; } } else if (neoDevice->isSubDevice()) { diff --git a/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h b/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h index 35fd93de37..26f6a8c7a6 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h @@ -31,7 +31,6 @@ class SysmanMultiDeviceInfoFixture : public ::testing::Test { hwInfo.gtSystemInfo.MultiTileArchInfo.Tile0 = 1; hwInfo.gtSystemInfo.MultiTileArchInfo.Tile1 = 1; auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u); - executionEnvironment->setExposeSubDevicesAsDevices(false); neoDevice = NEO::MockDevice::createWithExecutionEnvironment(&hwInfo, executionEnvironment, 0u); NEO::DeviceVector devices; diff --git a/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp b/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp index 7b6439223d..f56a360c94 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp +++ b/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp @@ -81,7 +81,7 @@ void MulticontextAubFixture::setUp(uint32_t numberOfTiles, EnabledCommandStreame strfilename << renderEngineName << "_CCS0_3"; // xehp_config_name_RCS_CCS0_3.aub } - auto filename = AUBCommandStreamReceiver::createFullFilePath(localHwInfo, strfilename.str(), rootDeviceIndex, platform()->peekExecutionEnvironment()->isExposingSubDevicesAsDevices()); + auto filename = AUBCommandStreamReceiver::createFullFilePath(localHwInfo, strfilename.str(), rootDeviceIndex); DebugManager.flags.AUBDumpCaptureFileName.set(filename); diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index da9a8560ee..fd5f9a3df9 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -735,7 +735,7 @@ TEST(ClDeviceHelperTest, givenNonZeroNumberOfTilesWhenPrepareDeviceEnvironmentsC HardwareInfo hwInfo{&platform, &skuTable, &waTable, &sysInfo, capTable}; DebugManager.flags.CreateMultipleSubDevices.set(0); - uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(false, &hwInfo); + uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); EXPECT_EQ(devicesCount, 3u); } @@ -751,7 +751,7 @@ TEST(ClDeviceHelperTest, givenZeroNumberOfTilesWhenPrepareDeviceEnvironmentsCoun HardwareInfo hwInfo{&platform, &skuTable, &waTable, &sysInfo, capTable}; DebugManager.flags.CreateMultipleSubDevices.set(0); - uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(false, &hwInfo); + uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); EXPECT_EQ(devicesCount, 1u); } diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 8f0a120bff..727a9f7f81 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -715,7 +715,7 @@ TEST_F(DrmTests, whenDrmIsCreatedWithMultipleSubDevicesThenCreateMultipleVirtual GTEST_SKIP(); } - auto numSubDevices = GfxCoreHelper::getSubDevicesCount(false, rootDeviceEnvironment->getHardwareInfo()); + auto numSubDevices = GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo()); for (auto id = 0u; id < numSubDevices; id++) { EXPECT_EQ(id + 1, drm->getVirtualMemoryAddressSpace(id)); } @@ -733,7 +733,7 @@ TEST_F(DrmTests, givenDebuggingEnabledWhenDrmIsCreatedThenPerContextVMIsTrueGetV if (drm->isVmBindAvailable()) { EXPECT_TRUE(drm->isPerContextVMRequired()); - auto numSubDevices = GfxCoreHelper::getSubDevicesCount(false, rootDeviceEnvironment->getHardwareInfo()); + auto numSubDevices = GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo()); for (auto id = 0u; id < numSubDevices; id++) { EXPECT_EQ(0u, drm->getVirtualMemoryAddressSpace(id)); } @@ -762,7 +762,7 @@ TEST_F(DrmTests, givenEnabledDebuggingAndVmBindNotAvailableWhenDrmIsCreatedThenP GTEST_SKIP(); } - auto numSubDevices = GfxCoreHelper::getSubDevicesCount(false, rootDeviceEnvironment->getHardwareInfo()); + auto numSubDevices = GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo()); for (auto id = 0u; id < numSubDevices; id++) { EXPECT_NE(0u, drm->getVirtualMemoryAddressSpace(id)); } diff --git a/shared/source/aub/aub_center.cpp b/shared/source/aub/aub_center.cpp index 791cab9645..ffaee0125d 100644 --- a/shared/source/aub/aub_center.cpp +++ b/shared/source/aub/aub_center.cpp @@ -9,7 +9,6 @@ #include "shared/source/aub/aub_helper.h" #include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" @@ -25,9 +24,8 @@ extern aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOpti AubCenter::AubCenter(const RootDeviceEnvironment &rootDeviceEnvironment, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) { if (DebugManager.flags.UseAubStream.get()) { auto hwInfo = rootDeviceEnvironment.getHardwareInfo(); - bool subDevicesAsDevices = rootDeviceEnvironment.executionEnvironment.isExposingSubDevicesAsDevices(); - auto devicesCount = GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, hwInfo); - auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(subDevicesAsDevices, hwInfo); + auto devicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); + auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(hwInfo); CommandStreamReceiverType type = csrType; if (DebugManager.flags.SetCommandStreamReceiver.get() >= CommandStreamReceiverType::CSR_HW) { type = static_cast(DebugManager.flags.SetCommandStreamReceiver.get()); diff --git a/shared/source/aub/aub_helper.cpp b/shared/source/aub/aub_helper.cpp index 8c1ba9d7ff..408152b3b2 100644 --- a/shared/source/aub/aub_helper.cpp +++ b/shared/source/aub/aub_helper.cpp @@ -42,10 +42,10 @@ uint32_t AubHelper::getMemType(uint32_t addressSpace) { return mem_types::MEM_TYPE_SYSTEM; } -uint64_t AubHelper::getPerTileLocalMemorySize(bool subDevicesAsDevices, const HardwareInfo *pHwInfo) { +uint64_t AubHelper::getPerTileLocalMemorySize(const HardwareInfo *pHwInfo) { if (DebugManager.flags.HBMSizePerTileInGigabytes.get() > 0) { return DebugManager.flags.HBMSizePerTileInGigabytes.get() * MemoryConstants::gigaByte; } - return getTotalMemBankSize() / GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, pHwInfo); + return getTotalMemBankSize() / GfxCoreHelper::getSubDevicesCount(pHwInfo); } } // namespace NEO diff --git a/shared/source/aub/aub_helper.h b/shared/source/aub/aub_helper.h index 586552a6a0..973a78b050 100644 --- a/shared/source/aub/aub_helper.h +++ b/shared/source/aub/aub_helper.h @@ -45,7 +45,7 @@ class AubHelper : public NonCopyableOrMovableClass { static int getMemTrace(uint64_t pdEntryBits); static uint64_t getPTEntryBits(uint64_t pdEntryBits); static uint32_t getMemType(uint32_t addressSpace); - static uint64_t getPerTileLocalMemorySize(bool subDevicesAsDevices, const HardwareInfo *pHwInfo); + static uint64_t getPerTileLocalMemorySize(const HardwareInfo *pHwInfo); static MMIOList getAdditionalMmioList(); static void setTbxConfiguration(); diff --git a/shared/source/command_stream/aub_command_stream_receiver.cpp b/shared/source/command_stream/aub_command_stream_receiver.cpp index ec13f00cc3..c6a13712e2 100644 --- a/shared/source/command_stream/aub_command_stream_receiver.cpp +++ b/shared/source/command_stream/aub_command_stream_receiver.cpp @@ -25,13 +25,13 @@ namespace NEO { AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE] = {}; -std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex, bool subDevicesAsDevices) { +std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex) { std::string hwPrefix = hardwarePrefix[hwInfo.platform.eProductFamily]; // Generate the full filename const auto >SystemInfo = hwInfo.gtSystemInfo; std::stringstream strfilename; - auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, &hwInfo); + auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); uint32_t subSlicesPerSlice = gtSystemInfo.SubSliceCount / gtSystemInfo.SliceCount; strfilename << hwPrefix << "_"; if (subDevicesCount > 1) { @@ -64,7 +64,7 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseN uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); - std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName, rootDeviceIndex, executionEnvironment.isExposingSubDevicesAsDevices()); + std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName, rootDeviceIndex); if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") { filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get()); } diff --git a/shared/source/command_stream/aub_command_stream_receiver.h b/shared/source/command_stream/aub_command_stream_receiver.h index b0d3ee7112..6350aa7d9c 100644 --- a/shared/source/command_stream/aub_command_stream_receiver.h +++ b/shared/source/command_stream/aub_command_stream_receiver.h @@ -22,7 +22,7 @@ struct AUBCommandStreamReceiver { ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield); - static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex, bool subDevicesAsDevices); + static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex); using AubFileStream = AubMemDump::AubFileStream; }; diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl index 45dccf242d..483b207e13 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl @@ -64,7 +64,7 @@ AUBCommandStreamReceiverHw::AUBCommandStreamReceiverHw(const std::str aubManager = aubCenter->getAubManager(); if (!aubCenter->getPhysicalAddressAllocator()) { - aubCenter->initPhysicalAddressAllocator(this->createPhysicalAddressAllocator(executionEnvironment.isExposingSubDevicesAsDevices(), &this->peekHwInfo())); + aubCenter->initPhysicalAddressAllocator(this->createPhysicalAddressAllocator(&this->peekHwInfo())); } auto physicalAddressAllocator = aubCenter->getPhysicalAddressAllocator(); UNRECOVERABLE_IF(nullptr == physicalAddressAllocator); diff --git a/shared/source/command_stream/command_stream_receiver_simulated_common_hw_xehp_and_later.inl b/shared/source/command_stream/command_stream_receiver_simulated_common_hw_xehp_and_later.inl index e029b3e92b..b9846d84c3 100644 --- a/shared/source/command_stream/command_stream_receiver_simulated_common_hw_xehp_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_simulated_common_hw_xehp_and_later.inl @@ -8,7 +8,6 @@ #include "shared/source/aub_mem_dump/page_table_entry_bits.h" #include "shared/source/command_stream/command_stream_receiver_simulated_common_hw_base.inl" #include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/source/execution_environment/execution_environment.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/memory_manager/memory_banks.h" #include "shared/source/memory_manager/memory_pool.h" @@ -35,7 +34,7 @@ void CommandStreamReceiverSimulatedCommonHw::initGlobalMMIO() { {0x0000490c, 0x0001}}; // XEHP_TILE_ADDR_RANGE const uint32_t numberOfTiles = 4; - const uint32_t localMemorySizeGB = static_cast(AubHelper::getPerTileLocalMemorySize(peekExecutionEnvironment().isExposingSubDevicesAsDevices(), &this->peekHwInfo()) / MemoryConstants::gigaByte); + const uint32_t localMemorySizeGB = static_cast(AubHelper::getPerTileLocalMemorySize(&this->peekHwInfo()) / MemoryConstants::gigaByte); uint32_t localMemoryBaseAddressInGB = 0x0; diff --git a/shared/source/command_stream/command_stream_receiver_simulated_hw.h b/shared/source/command_stream/command_stream_receiver_simulated_hw.h index 6bd87871ca..bcfe0dc90b 100644 --- a/shared/source/command_stream/command_stream_receiver_simulated_hw.h +++ b/shared/source/command_stream/command_stream_receiver_simulated_hw.h @@ -85,9 +85,9 @@ class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCo } return AubMemDump::AddressSpaceValues::TraceNonlocal; } - PhysicalAddressAllocator *createPhysicalAddressAllocator(bool subDevicesAsDevices, const HardwareInfo *hwInfo) { - const auto bankSize = AubHelper::getPerTileLocalMemorySize(subDevicesAsDevices, hwInfo); - const auto devicesCount = GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, hwInfo); + PhysicalAddressAllocator *createPhysicalAddressAllocator(const HardwareInfo *hwInfo) { + const auto bankSize = AubHelper::getPerTileLocalMemorySize(hwInfo); + const auto devicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); return new PhysicalAddressAllocatorHw(bankSize, devicesCount); } void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation, bool isChunkCopy, uint64_t gpuVaChunkOffset, size_t chunkSize) override { diff --git a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl index 01df12a095..e6d5a0d41e 100644 --- a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl +++ b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl @@ -41,7 +41,7 @@ TbxCommandStreamReceiverHw::TbxCommandStreamReceiverHw(ExecutionEnvir forceSkipResourceCleanupRequired = true; - physicalAddressAllocator.reset(this->createPhysicalAddressAllocator(executionEnvironment.isExposingSubDevicesAsDevices(), &this->peekHwInfo())); + physicalAddressAllocator.reset(this->createPhysicalAddressAllocator(&this->peekHwInfo())); executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAubCenter(this->localMemoryEnabled, "", this->getType()); auto aubCenter = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter.get(); UNRECOVERABLE_IF(nullptr == aubCenter); @@ -173,7 +173,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std:: const auto &productHelper = rootDeviceEnvironment.getHelper(); if (withAubDump) { auto localMemoryEnabled = gfxCoreHelper.getEnableLocalMemory(hwInfo); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName, rootDeviceIndex, executionEnvironment.isExposingSubDevicesAsDevices()); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName, rootDeviceIndex); if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") { fullName.assign(DebugManager.flags.AUBDumpCaptureFileName.get()); } diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 09b967954f..90604fddad 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -84,7 +84,7 @@ SubDevice *Device::createEngineInstancedSubDevice(uint32_t subDeviceIndex, aub_s bool Device::genericSubDevicesAllowed() { auto deviceMask = executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->deviceAffinityMask.getGenericSubDevicesMask(); - uint32_t subDeviceCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment->isExposingSubDevicesAsDevices(), &getHardwareInfo()); + uint32_t subDeviceCount = GfxCoreHelper::getSubDevicesCount(&getHardwareInfo()); deviceBitfield = maxNBitValue(subDeviceCount); deviceBitfield &= deviceMask; numSubDevices = static_cast(deviceBitfield.count()); @@ -99,7 +99,7 @@ bool Device::engineInstancedSubDevicesAllowed() { bool notAllowed = !DebugManager.flags.EngineInstancedSubDevices.get(); notAllowed |= engineInstanced; notAllowed |= (getHardwareInfo().gtSystemInfo.CCSInfo.NumberOfCCSEnabled < 2); - notAllowed |= ((GfxCoreHelper::getSubDevicesCount(executionEnvironment->isExposingSubDevicesAsDevices(), &getHardwareInfo()) < 2) && (!DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.get())); + notAllowed |= ((GfxCoreHelper::getSubDevicesCount(&getHardwareInfo()) < 2) && (!DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.get())); if (notAllowed) { return false; @@ -147,7 +147,7 @@ bool Device::createEngineInstancedSubDevices() { bool Device::createGenericSubDevices() { UNRECOVERABLE_IF(!subdevices.empty()); - uint32_t subDeviceCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment->isExposingSubDevicesAsDevices(), &getHardwareInfo()); + uint32_t subDeviceCount = GfxCoreHelper::getSubDevicesCount(&getHardwareInfo()); subdevices.resize(subDeviceCount, nullptr); @@ -758,7 +758,7 @@ bool Device::getUuid(std::array &uuid) { uuid = this->uuid.id; auto hwInfo = getHardwareInfo(); - auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment->isExposingSubDevicesAsDevices(), &hwInfo); + auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); if (subDevicesCount > 1 && deviceBitfield.count() == 1) { // In case of no sub devices created (bits set in affinity mask == 1), return the UUID of enabled sub-device. @@ -879,7 +879,7 @@ void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) { bool allocFailed = false; - const auto deviceCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment->isExposingSubDevicesAsDevices(), executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->getHardwareInfo()); + const auto deviceCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->getHardwareInfo()); auto dispatchGlobalsSize = deviceCount * dispatchGlobalsStride; auto rtStackSize = RayTracingHelper::getRTStackSizePerTile(*this, deviceCount, maxBvhLevels, extraBytesLocal, extraBytesGlobal); diff --git a/shared/source/device/device_caps.cpp b/shared/source/device/device_caps.cpp index 177b134418..8490e31063 100644 --- a/shared/source/device/device_caps.cpp +++ b/shared/source/device/device_caps.cpp @@ -83,7 +83,7 @@ void Device::initializeCaps() { deviceInfo.globalMemSize = alignDown(deviceInfo.globalMemSize, MemoryConstants::pageSize); deviceInfo.maxMemAllocSize = std::min(deviceInfo.globalMemSize, deviceInfo.maxMemAllocSize); // if globalMemSize was reduced for 32b - uint32_t subDeviceCount = gfxCoreHelper.getSubDevicesCount(this->executionEnvironment->isExposingSubDevicesAsDevices(), &getHardwareInfo()); + uint32_t subDeviceCount = gfxCoreHelper.getSubDevicesCount(&getHardwareInfo()); auto &rootDeviceEnvironment = this->getRootDeviceEnvironment(); bool platformImplicitScaling = gfxCoreHelper.platformSupportsImplicitScaling(rootDeviceEnvironment); diff --git a/shared/source/dll/linux/drm_neo_create.cpp b/shared/source/dll/linux/drm_neo_create.cpp index 256008ddff..ae769c6d83 100644 --- a/shared/source/dll/linux/drm_neo_create.cpp +++ b/shared/source/dll/linux/drm_neo_create.cpp @@ -113,7 +113,7 @@ Drm *Drm::create(std::unique_ptr &&hwDeviceId, RootDeviceEnvironm drm->isChunkingAvailable(); if (!drm->isPerContextVMRequired()) { - if (!drm->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.executionEnvironment.isExposingSubDevicesAsDevices(), rootDeviceEnvironment.getHardwareInfo()))) { + if (!drm->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo()))) { printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "INFO: Device doesn't support GEM Virtual Memory\n"); } } diff --git a/shared/source/execution_environment/execution_environment.cpp b/shared/source/execution_environment/execution_environment.cpp index 64b3109a13..24d797c33b 100644 --- a/shared/source/execution_environment/execution_environment.cpp +++ b/shared/source/execution_environment/execution_environment.cpp @@ -89,7 +89,7 @@ void ExecutionEnvironment::calculateMaxOsContextCount() { auto hwInfo = rootDeviceEnvironment->getHardwareInfo(); auto &gfxCoreHelper = rootDeviceEnvironment->getHelper(); auto osContextCount = static_cast(gfxCoreHelper.getGpgpuEngineInstances(*rootDeviceEnvironment).size()); - auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(this->isExposingSubDevicesAsDevices(), hwInfo); + auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); auto ccsCount = hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled; bool hasRootCsr = subDevicesCount > 1; @@ -186,7 +186,7 @@ void ExecutionEnvironment::parseAffinityMask() { if (exposeSubDevicesAsApiDevices) { for (uint32_t currentRootDevice = 0u; currentRootDevice < static_cast(rootDeviceEnvironments.size()); currentRootDevice++) { auto hwInfo = rootDeviceEnvironments[currentRootDevice]->getHardwareInfo(); - hwSubDevicesCount = GfxCoreHelper::getSubDevicesCount(this->isExposingSubDevicesAsDevices(), hwInfo); + hwSubDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); uint32_t currentSubDevice = 0; mapOfIndices.push_back(std::make_tuple(currentRootDevice, currentSubDevice)); for (currentSubDevice = 1; currentSubDevice < hwSubDevicesCount; currentSubDevice++) { @@ -231,7 +231,7 @@ void ExecutionEnvironment::parseAffinityMask() { // cards as devices if (rootDeviceIndex < numRootDevices) { auto hwInfo = rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); - auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(this->isExposingSubDevicesAsDevices(), hwInfo); + auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); if (subEntries.size() > 1) { uint32_t subDeviceIndex = StringHelpers::toUint32t(subEntries[1]); diff --git a/shared/source/execution_environment/root_device_environment.h b/shared/source/execution_environment/root_device_environment.h index a8a14be21e..294dbf973d 100644 --- a/shared/source/execution_environment/root_device_environment.h +++ b/shared/source/execution_environment/root_device_environment.h @@ -45,6 +45,9 @@ struct AllocationProperties; struct HardwareInfo; struct RootDeviceEnvironment : NonCopyableClass { + protected: + std::unique_ptr hwInfo; + public: RootDeviceEnvironment(ExecutionEnvironment &executionEnvironment); MOCKABLE_VIRTUAL ~RootDeviceEnvironment(); @@ -120,7 +123,6 @@ struct RootDeviceEnvironment : NonCopyableClass { bool isWddmOnLinuxEnable = false; std::once_flag isDummyAllocationInitialized; std::unique_ptr dummyBlitProperties; - std::unique_ptr hwInfo; private: std::mutex mtx; diff --git a/shared/source/helpers/gfx_core_helper.cpp b/shared/source/helpers/gfx_core_helper.cpp index 5fb6ad3377..0d49ba0391 100644 --- a/shared/source/helpers/gfx_core_helper.cpp +++ b/shared/source/helpers/gfx_core_helper.cpp @@ -69,10 +69,10 @@ uint32_t GfxCoreHelper::getMaxThreadsForVfe(const HardwareInfo &hwInfo) { return maxHwThreadsReturned; } -uint32_t GfxCoreHelper::getSubDevicesCount(bool subDevicesAsDevices, const HardwareInfo *pHwInfo) { +uint32_t GfxCoreHelper::getSubDevicesCount(const HardwareInfo *pHwInfo) { if (DebugManager.flags.CreateMultipleSubDevices.get() > 0) { return DebugManager.flags.CreateMultipleSubDevices.get(); - } else if (DebugManager.flags.ReturnSubDevicesAsApiDevices.get() > 0 || subDevicesAsDevices) { + } else if (DebugManager.flags.ReturnSubDevicesAsApiDevices.get() > 0) { return 1u; } else if (pHwInfo->gtSystemInfo.MultiTileArchInfo.IsValid && pHwInfo->gtSystemInfo.MultiTileArchInfo.TileCount > 0u) { return pHwInfo->gtSystemInfo.MultiTileArchInfo.TileCount; diff --git a/shared/source/helpers/gfx_core_helper.h b/shared/source/helpers/gfx_core_helper.h index 40259a3a6c..7843116110 100644 --- a/shared/source/helpers/gfx_core_helper.h +++ b/shared/source/helpers/gfx_core_helper.h @@ -142,7 +142,7 @@ class GfxCoreHelper { virtual bool unTypedDataPortCacheFlushRequired() const = 0; virtual bool isEngineTypeRemappingToHwSpecificRequired() const = 0; - static uint32_t getSubDevicesCount(bool subDevicesAsDevices, const HardwareInfo *pHwInfo); + static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo); virtual bool isSipKernelAsHexadecimalArrayPreferred() const = 0; virtual void setSipKernelData(uint32_t *&sipKernelBinary, size_t &kernelBinarySize) const = 0; diff --git a/shared/source/memory_manager/definitions/storage_info.cpp b/shared/source/memory_manager/definitions/storage_info.cpp index 9b523f6f11..689131c1c2 100644 --- a/shared/source/memory_manager/definitions/storage_info.cpp +++ b/shared/source/memory_manager/definitions/storage_info.cpp @@ -28,7 +28,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope return storageInfo; } - const auto deviceCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment.isExposingSubDevicesAsDevices(), executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->getHardwareInfo()); + const auto deviceCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->getHardwareInfo()); const auto leastOccupiedBank = getLocalMemoryUsageBankSelector(properties.allocationType, properties.rootDeviceIndex)->getLeastOccupiedBank(properties.subDevicesBitfield); const auto subDevicesMask = executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->deviceAffinityMask.getGenericSubDevicesMask().to_ulong(); diff --git a/shared/source/memory_manager/memory_manager.cpp b/shared/source/memory_manager/memory_manager.cpp index c6b06132f1..7854092033 100644 --- a/shared/source/memory_manager/memory_manager.cpp +++ b/shared/source/memory_manager/memory_manager.cpp @@ -55,14 +55,13 @@ MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : execu checkIsaPlacementOnceFlags = std::make_unique(rootEnvCount); isaInLocalMemory.resize(rootEnvCount); allRegisteredEngines.resize(rootEnvCount + 1); - bool subDevicesAsDevices = executionEnvironment.isExposingSubDevicesAsDevices(); for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < rootEnvCount; ++rootDeviceIndex) { auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]; auto hwInfo = rootDeviceEnvironment.getHardwareInfo(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); - internalLocalMemoryUsageBankSelector.emplace_back(new LocalMemoryUsageBankSelector(GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, hwInfo))); - externalLocalMemoryUsageBankSelector.emplace_back(new LocalMemoryUsageBankSelector(GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, hwInfo))); + internalLocalMemoryUsageBankSelector.emplace_back(new LocalMemoryUsageBankSelector(GfxCoreHelper::getSubDevicesCount(hwInfo))); + externalLocalMemoryUsageBankSelector.emplace_back(new LocalMemoryUsageBankSelector(GfxCoreHelper::getSubDevicesCount(hwInfo))); this->localMemorySupported.push_back(gfxCoreHelper.getEnableLocalMemory(*hwInfo)); this->enable64kbpages.push_back(OSInterface::osEnabled64kbPages && hwInfo->capabilityTable.ftr64KBpages && !!DebugManager.flags.Enable64kbpages.get()); diff --git a/shared/source/memory_manager/os_agnostic_memory_manager.cpp b/shared/source/memory_manager/os_agnostic_memory_manager.cpp index 75d16ec687..a2e1af7213 100644 --- a/shared/source/memory_manager/os_agnostic_memory_manager.cpp +++ b/shared/source/memory_manager/os_agnostic_memory_manager.cpp @@ -662,7 +662,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( uint64_t OsAgnosticMemoryManager::getLocalMemorySize(uint32_t rootDeviceIndex, uint32_t deviceBitfield) { DeviceBitfield bitfield = deviceBitfield; - return (AubHelper::getPerTileLocalMemorySize(executionEnvironment.isExposingSubDevicesAsDevices(), executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()) * bitfield.count()); + return (AubHelper::getPerTileLocalMemorySize(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()) * bitfield.count()); } double OsAgnosticMemoryManager::getPercentOfGlobalMemoryAvailable(uint32_t rootDeviceIndex) { diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index e5f1aa8148..704a0aa070 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -1495,7 +1495,7 @@ uint64_t DrmMemoryManager::getLocalMemorySize(uint32_t rootDeviceIndex, uint32_t } auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); - uint32_t subDevicesCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment.isExposingSubDevicesAsDevices(), hwInfo); + uint32_t subDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); size_t size = 0; for (uint32_t i = 0; i < subDevicesCount; i++) { diff --git a/shared/source/os_interface/linux/drm_memory_operations_handler_bind.cpp b/shared/source/os_interface/linux/drm_memory_operations_handler_bind.cpp index ac6c7035cf..562c5a50d5 100644 --- a/shared/source/os_interface/linux/drm_memory_operations_handler_bind.cpp +++ b/shared/source/os_interface/linux/drm_memory_operations_handler_bind.cpp @@ -170,10 +170,8 @@ MemoryOperationsStatus DrmMemoryOperationsHandlerBind::evictUnusedAllocations(bo MemoryOperationsStatus DrmMemoryOperationsHandlerBind::evictUnusedAllocationsImpl(std::vector &allocationsForEviction, bool waitForCompletion) { const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines(this->rootDeviceIndex); std::vector evictCandidates; - bool subDevicesAsDevices = rootDeviceEnvironment.executionEnvironment.isExposingSubDevicesAsDevices(); - for (auto subdeviceIndex = 0u; subdeviceIndex < GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, rootDeviceEnvironment.getHardwareInfo()); - subdeviceIndex++) { + for (auto subdeviceIndex = 0u; subdeviceIndex < GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo()); subdeviceIndex++) { for (auto &allocation : allocationsForEviction) { bool evict = true; diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 1f0b0aedf5..6d5e4985b4 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -1424,7 +1424,7 @@ bool WddmMemoryManager::mapGpuVirtualAddress(WddmAllocation *allocation, const v uint64_t WddmMemoryManager::getLocalMemorySize(uint32_t rootDeviceIndex, uint32_t deviceBitfield) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); - uint64_t subDevicesCount = GfxCoreHelper::getSubDevicesCount(executionEnvironment.isExposingSubDevicesAsDevices(), hwInfo); + uint64_t subDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); auto singleRegionSize = getWddm(rootDeviceIndex).getDedicatedVideoMemory() / subDevicesCount; diff --git a/shared/test/common/libult/linux/drm_mock.cpp b/shared/test/common/libult/linux/drm_mock.cpp index c06689502e..fe78c322a9 100644 --- a/shared/test/common/libult/linux/drm_mock.cpp +++ b/shared/test/common/libult/linux/drm_mock.cpp @@ -33,7 +33,7 @@ DrmMock::DrmMock(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily); if (!isPerContextVMRequired()) { - createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.executionEnvironment.isExposingSubDevicesAsDevices(), rootDeviceEnvironment.getHardwareInfo())); + createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo())); } storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | diff --git a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp index e4d5bbe04e..ae0c312db4 100644 --- a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp @@ -7,7 +7,6 @@ #include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" -#include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/os_interface/linux/i915.h" @@ -229,7 +228,7 @@ DrmMockCustom::DrmMockCustom(RootDeviceEnvironment &rootDeviceEnvironment) ioctlExpected.contextCreate = static_cast(gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment).size()); ioctlExpected.contextDestroy = ioctlExpected.contextCreate.load(); setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily); - createVirtualMemoryAddressSpace(NEO::GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.executionEnvironment.isExposingSubDevicesAsDevices(), rootDeviceEnvironment.getHardwareInfo())); + createVirtualMemoryAddressSpace(NEO::GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo())); isVmBindAvailable(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) reset(); } diff --git a/shared/test/common/os_interface/linux/drm_command_stream_fixture.h b/shared/test/common/os_interface/linux/drm_command_stream_fixture.h index af9014e004..38a4d02ae5 100644 --- a/shared/test/common/os_interface/linux/drm_command_stream_fixture.h +++ b/shared/test/common/os_interface/linux/drm_command_stream_fixture.h @@ -51,7 +51,7 @@ class DrmCommandStreamTest : public ::testing::Test { gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto &gfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper(); - mock->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(executionEnvironment.isExposingSubDevicesAsDevices(), hwInfo)); + mock->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(hwInfo)); osContext = std::make_unique(*mock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment.rootDeviceEnvironments[0])[0], PreemptionHelper::getDefaultPreemptionMode(*hwInfo))); diff --git a/shared/test/common/os_interface/linux/drm_neo_create.cpp b/shared/test/common/os_interface/linux/drm_neo_create.cpp index c1b835366e..6e9fe65fae 100644 --- a/shared/test/common/os_interface/linux/drm_neo_create.cpp +++ b/shared/test/common/os_interface/linux/drm_neo_create.cpp @@ -59,7 +59,7 @@ Drm *Drm::create(std::unique_ptr &&hwDeviceId, RootDeviceEnvironm } if (!drm->isPerContextVMRequired()) { - drm->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.executionEnvironment.isExposingSubDevicesAsDevices(), hwInfo)); + drm->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(hwInfo)); } return drm; diff --git a/shared/test/unit_test/aub/aub_helper_tests.cpp b/shared/test/unit_test/aub/aub_helper_tests.cpp index 9b4c129153..e23e1bcdd2 100644 --- a/shared/test/unit_test/aub/aub_helper_tests.cpp +++ b/shared/test/unit_test/aub/aub_helper_tests.cpp @@ -43,11 +43,11 @@ TEST(AubHelper, GivenMultipleSubDevicesWhenGettingDeviceCountThenCorrectValueIsR HardwareInfo hwInfo{&platform, &featureTable, &workaroundTable, &sysInfo, capTable}; DebugManager.flags.CreateMultipleSubDevices.set(2); - uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(false, &hwInfo); + uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); EXPECT_EQ(devicesCount, 2u); DebugManager.flags.CreateMultipleSubDevices.set(0); - devicesCount = GfxCoreHelper::getSubDevicesCount(false, &hwInfo); + devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); EXPECT_EQ(devicesCount, 1u); } @@ -63,11 +63,11 @@ TEST(AubHelper, GivenReturnSubDevicesAsApiDevicesWhenGettingDeviceCountThenCorre sysInfo.MultiTileArchInfo.TileCount = 2; HardwareInfo hwInfo{&platform, &featureTable, &workaroundTable, &sysInfo, capTable}; - uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(false, &hwInfo); + uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); EXPECT_EQ(devicesCount, 2u); DebugManager.flags.ReturnSubDevicesAsApiDevices.set(1); - devicesCount = GfxCoreHelper::getSubDevicesCount(false, &hwInfo); + devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo); EXPECT_EQ(devicesCount, 1u); } @@ -102,13 +102,13 @@ TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsSetThenGetMemBankSizeReturnsCorre sysInfo.MultiTileArchInfo.IsValid = true; sysInfo.MultiTileArchInfo.TileCount = 1; - EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(false, &hwInfo)); + EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); sysInfo.MultiTileArchInfo.TileCount = 2; - EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(false, &hwInfo)); + EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); sysInfo.MultiTileArchInfo.TileCount = 4; - EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(false, &hwInfo)); + EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); } TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsNotSetThenGetMemBankSizeReturnsCorrectValue) { @@ -117,13 +117,13 @@ TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsNotSetThenGetMemBankSizeReturnsCo sysInfo.MultiTileArchInfo.IsValid = true; sysInfo.MultiTileArchInfo.TileCount = 1; - EXPECT_EQ(32 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(false, &hwInfo)); + EXPECT_EQ(32 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); sysInfo.MultiTileArchInfo.TileCount = 2; - EXPECT_EQ(16 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(false, &hwInfo)); + EXPECT_EQ(16 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); sysInfo.MultiTileArchInfo.TileCount = 4; - EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(false, &hwInfo)); + EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); } using AubHelperHwTest = Test; diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index e2c0d86c4b..8ec53bb048 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -1007,7 +1007,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenSshSize HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenPhysicalAddressAllocatorIsCreatedThenItIsNotNull) { MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - std::unique_ptr allocator(aubCsr.createPhysicalAddressAllocator(pDevice->getExecutionEnvironment()->isExposingSubDevicesAsDevices(), &hardwareInfo)); + std::unique_ptr allocator(aubCsr.createPhysicalAddressAllocator(&hardwareInfo)); ASSERT_NE(nullptr, allocator); } diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp index ebeac40366..739b136300 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp @@ -231,7 +231,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, whenPhys std::unique_ptr> aubCsr(new MockAubCsrXeHPAndLater("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); - auto physicalAddressAllocator = std::unique_ptr(aubCsr->createPhysicalAddressAllocator(pDevice->getExecutionEnvironment()->isExposingSubDevicesAsDevices(), &pDevice->getHardwareInfo())); + auto physicalAddressAllocator = std::unique_ptr(aubCsr->createPhysicalAddressAllocator(&pDevice->getHardwareInfo())); auto allocator = reinterpret_cast *>(physicalAddressAllocator.get()); EXPECT_EQ(32 * MemoryConstants::gigaByte, allocator->getBankSize()); @@ -245,7 +245,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, whenPhys std::unique_ptr> aubCsr(new MockAubCsrXeHPAndLater("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); - auto physicalAddressAllocator = std::unique_ptr(aubCsr->createPhysicalAddressAllocator(pDevice->getExecutionEnvironment()->isExposingSubDevicesAsDevices(), &pDevice->getHardwareInfo())); + auto physicalAddressAllocator = std::unique_ptr(aubCsr->createPhysicalAddressAllocator(&pDevice->getHardwareInfo())); auto allocator = reinterpret_cast *>(physicalAddressAllocator.get()); EXPECT_EQ(8 * MemoryConstants::gigaByte, allocator->getBankSize()); diff --git a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp index 0ad185eff5..fb63597a67 100644 --- a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -953,17 +953,17 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePath DebugManagerStateRestore stateRestore; DebugManager.flags.CreateMultipleSubDevices.set(1); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex, false); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); EXPECT_EQ(std::string::npos, fullName.find("tx")); DebugManager.flags.CreateMultipleSubDevices.set(2); - fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex, false); + fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); EXPECT_NE(std::string::npos, fullName.find("2tx")); } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePathIsCalledThenFileNameIsExtendedWithRootDeviceIndex) { uint32_t rootDeviceIndex = 123u; - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", rootDeviceIndex, false); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", rootDeviceIndex); EXPECT_NE(std::string::npos, fullName.find("_123_aubfile.aub")); } @@ -971,7 +971,7 @@ HWTEST_F(AubFileStreamTests, givenGenerateAubFilePerProcessIdDebugFlagAndAubComm DebugManagerStateRestore stateRestore; DebugManager.flags.GenerateAubFilePerProcessId.set(1); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", 1u, false); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", 1u); std::stringstream strExtendedFileName; strExtendedFileName << "_1_aubfile_PID_" << SysCalls::getProcessId() << ".aub"; EXPECT_NE(std::string::npos, fullName.find(strExtendedFileName.str())); diff --git a/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp index a8838a265e..02b6d081a3 100644 --- a/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -446,7 +446,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, whenTbxCommandStreamReceiverIsCreatedThenPPG HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCommandStreamReceiverWhenPhysicalAddressAllocatorIsCreatedThenItIsNotNull) { MockTbxCsr tbxCsr(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()); - std::unique_ptr allocator(tbxCsr.createPhysicalAddressAllocator(pDevice->getExecutionEnvironment()->isExposingSubDevicesAsDevices(), &hardwareInfo)); + std::unique_ptr allocator(tbxCsr.createPhysicalAddressAllocator(&hardwareInfo)); ASSERT_NE(nullptr, allocator); } @@ -615,7 +615,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE auto rootDeviceEnvironment = static_cast(executionEnvironment.rootDeviceEnvironments[0].get()); setMockAubCenter(*rootDeviceEnvironment, CommandStreamReceiverType::CSR_TBX); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex, executionEnvironment.isExposingSubDevicesAsDevices()); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0, 1))); EXPECT_STREQ(fullName.c_str(), rootDeviceEnvironment->aubFileNameReceived.c_str()); diff --git a/shared/test/unit_test/execution_environment/execution_environment_tests.cpp b/shared/test/unit_test/execution_environment/execution_environment_tests.cpp index c4fe39a5fe..f949a2c804 100644 --- a/shared/test/unit_test/execution_environment/execution_environment_tests.cpp +++ b/shared/test/unit_test/execution_environment/execution_environment_tests.cpp @@ -455,12 +455,12 @@ TEST(ExecutionEnvironment, whenCalculateMaxOsContexCountThenGlobalVariableHasPro { DebugManager.flags.EngineInstancedSubDevices.set(false); MockExecutionEnvironment executionEnvironment(nullptr, true, numRootDevices); - bool subDevicesAsDevices = executionEnvironment.isExposingSubDevicesAsDevices(); + for (const auto &rootDeviceEnvironment : executionEnvironment.rootDeviceEnvironments) { auto hwInfo = rootDeviceEnvironment->getHardwareInfo(); auto &gfxCoreHelper = rootDeviceEnvironment->getHelper(); auto osContextCount = gfxCoreHelper.getGpgpuEngineInstances(*rootDeviceEnvironment).size(); - auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, hwInfo); + auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); bool hasRootCsr = subDevicesCount > 1; auto ccsCount = hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled; diff --git a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp index b7f3b8dd00..b03a38ba2b 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp @@ -626,11 +626,10 @@ TEST(MemoryManagerTest, givenOsAgnosticMemoryManagerWhenGetLocalMemoryIsCalledTh auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); - bool subDevicesAsDevices = executionEnvironment.isExposingSubDevicesAsDevices(); - auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(subDevicesAsDevices, hwInfo); + auto subDevicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); uint32_t deviceMask = static_cast(maxNBitValue(subDevicesCount)); - EXPECT_EQ(AubHelper::getPerTileLocalMemorySize(subDevicesAsDevices, hwInfo) * subDevicesCount, memoryManager.getLocalMemorySize(0u, deviceMask)); + EXPECT_EQ(AubHelper::getPerTileLocalMemorySize(hwInfo) * subDevicesCount, memoryManager.getLocalMemorySize(0u, deviceMask)); } HWTEST_F(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocatingKernelIsaThenLocalMemoryPoolIsUsed) { diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp index 7d059a1acf..5f58e79644 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp @@ -315,7 +315,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test { executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock, 0u); executionEnvironment.rootDeviceEnvironments[0]->initGmm(); - mock->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(executionEnvironment.isExposingSubDevicesAsDevices(), hwInfo)); + mock->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(hwInfo)); auto &gfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper(); osContext = std::make_unique(*mock, rootDeviceIndex, 0, @@ -421,7 +421,7 @@ struct DrmImplicitScalingCommandStreamTest : ::testing::Test { constexpr int mockFd = 33; drm = new DrmMock(mockFd, *executionEnvironment->rootDeviceEnvironments[0]); drm->setupIoctlHelper(hwInfo->platform.eProductFamily); - drm->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(executionEnvironment->isExposingSubDevicesAsDevices(), hwInfo.get())); + drm->createVirtualMemoryAddressSpace(GfxCoreHelper::getSubDevicesCount(hwInfo.get())); executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(hwInfo.get()); executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drm));