diff --git a/Jenkinsfile b/Jenkinsfile index e9819c2198..cd4c31c6f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!groovy dependenciesRevision='88b9b8081c963d105ae1815384e62d225a92ca51-1208' strategy='EQUAL' -allowedCD=267 +allowedCD=268 allowedF=4 diff --git a/manifests/manifest.yml b/manifests/manifest.yml index 2abfca5712..a5e0336628 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -17,7 +17,7 @@ components: branch: infra clean_on_sync: true dest_dir: infra - revision: 072a94e48949a8711f01985d8e2104e325fec8e4 + revision: 6879e753cb58f381af3736f99c615f98dbaed4fc type: git internal: branch: master diff --git a/runtime/command_stream/command_stream_receiver_hw.inl b/runtime/command_stream/command_stream_receiver_hw.inl index 0d1e9db116..7cb3ea4df2 100644 --- a/runtime/command_stream/command_stream_receiver_hw.inl +++ b/runtime/command_stream/command_stream_receiver_hw.inl @@ -42,10 +42,10 @@ CommandStreamReceiverHw::CommandStreamReceiverHw(const HardwareInfo & : CommandStreamReceiver(executionEnvironment), hwInfo(hwInfoIn) { auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily); - localMemoryEnabled = hwHelper.isLocalMemoryEnabled(hwInfo); + localMemoryEnabled = hwHelper.getEnableLocalMemory(hwInfo); requiredThreadArbitrationPolicy = PreambleHelper::getDefaultThreadArbitrationPolicy(); - resetKmdNotifyHelper(new KmdNotifyHelper(&(hwInfoIn.capabilityTable.kmdNotifyProperties))); + resetKmdNotifyHelper(new KmdNotifyHelper(&hwInfoIn.capabilityTable.kmdNotifyProperties)); flatBatchBufferHelper.reset(new FlatBatchBufferHelperHw(executionEnvironment)); defaultSshSize = getSshHeapSize(); diff --git a/runtime/command_stream/tbx_command_stream_receiver_hw.inl b/runtime/command_stream/tbx_command_stream_receiver_hw.inl index c841efa82c..9755132f4e 100644 --- a/runtime/command_stream/tbx_command_stream_receiver_hw.inl +++ b/runtime/command_stream/tbx_command_stream_receiver_hw.inl @@ -171,7 +171,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const Hardw TbxCommandStreamReceiverHw *csr; if (withAubDump) { auto &hwHelper = HwHelper::get(hwInfoIn.pPlatform->eRenderCoreFamily); - auto localMemoryEnabled = hwHelper.isLocalMemoryEnabled(hwInfoIn); + auto localMemoryEnabled = hwHelper.getEnableLocalMemory(hwInfoIn); executionEnvironment.initAubCenter(&hwInfoIn, localMemoryEnabled, baseName); csr = new CommandStreamReceiverWithAUBDump>(hwInfoIn, baseName, executionEnvironment); diff --git a/runtime/device/device.cpp b/runtime/device/device.cpp index 89f9cc2043..0ab22e15d0 100644 --- a/runtime/device/device.cpp +++ b/runtime/device/device.cpp @@ -149,7 +149,7 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo) { } } - for (auto engine : engines) { + for (auto &engine : engines) { auto csr = engine.commandStreamReceiver; csr->setPreemptionCsrAllocation(preemptionAllocation); if (DebugManager.flags.EnableExperimentalCommandBuffer.get() > 0) { @@ -162,14 +162,15 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo) { bool Device::createEngines(const HardwareInfo *pHwInfo) { auto defaultEngineType = getChosenEngineType(*pHwInfo); - auto &gpgpuEngines = HwHelper::get(pHwInfo->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances(); + auto &hwHelper = HwHelper::get(pHwInfo->pPlatform->eRenderCoreFamily); + auto &gpgpuEngines = hwHelper.getGpgpuEngineInstances(); + auto enableLocalMemory = hwHelper.getEnableLocalMemory(*pHwInfo); for (uint32_t deviceCsrIndex = 0; deviceCsrIndex < gpgpuEngines.size(); deviceCsrIndex++) { if (!executionEnvironment->initializeCommandStreamReceiver(pHwInfo, getDeviceIndex(), deviceCsrIndex)) { return false; } - executionEnvironment->initializeMemoryManager(getEnabled64kbPages(), getEnableLocalMemory(), - getDeviceIndex(), deviceCsrIndex); + executionEnvironment->initializeMemoryManager(getEnabled64kbPages(), enableLocalMemory, getDeviceIndex(), deviceCsrIndex); auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(gpgpuEngines[deviceCsrIndex], preemptionMode); auto commandStreamReceiver = executionEnvironment->commandStreamReceivers[getDeviceIndex()][deviceCsrIndex].get(); diff --git a/runtime/device/device.h b/runtime/device/device.h index 7152f2b4be..1eda9953bb 100644 --- a/runtime/device/device.h +++ b/runtime/device/device.h @@ -109,8 +109,7 @@ class Device : public BaseObject<_cl_device_id> { std::vector simultaneousInterops; std::string deviceExtensions; std::string name; - bool getEnabled64kbPages(); - bool getEnableLocalMemory(); + bool getEnabled64kbPages() const; bool isSourceLevelDebuggerActive() const; SourceLevelDebugger *getSourceLevelDebugger() { return executionEnvironment->sourceLevelDebugger.get(); } ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; } @@ -159,7 +158,7 @@ class Device : public BaseObject<_cl_device_id> { PreemptionMode preemptionMode; ExecutionEnvironment *executionEnvironment = nullptr; - uint32_t deviceIndex = 0u; + const uint32_t deviceIndex; uint32_t defaultEngineIndex = 0; }; diff --git a/runtime/device/device_caps.cpp b/runtime/device/device_caps.cpp index 36ab615976..66ed62f7de 100644 --- a/runtime/device/device_caps.cpp +++ b/runtime/device/device_caps.cpp @@ -42,7 +42,7 @@ static constexpr cl_device_fp_config defaultFpFlags = static_cast getGpgpuEngineInstances() const = 0; + virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0; protected: HwHelper() = default; @@ -115,7 +116,7 @@ class HwHelperHw : public HwHelper { uint32_t getConfigureAddressSpaceMode() override; - bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) override; + bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const override; bool supportsYTiling() const override; @@ -138,6 +139,8 @@ class HwHelperHw : public HwHelper { const std::vector getGpgpuEngineInstances() const override; + bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override; + protected: HwHelperHw() = default; }; diff --git a/runtime/helpers/hw_helper_common.inl b/runtime/helpers/hw_helper_common.inl index ef38ccd8ba..4c07528bb7 100644 --- a/runtime/helpers/hw_helper_common.inl +++ b/runtime/helpers/hw_helper_common.inl @@ -14,6 +14,7 @@ #include "runtime/helpers/hw_info.h" #include "runtime/memory_manager/graphics_allocation.h" #include "runtime/memory_manager/memory_constants.h" +#include "runtime/os_interface/os_interface.h" namespace OCLRT { @@ -27,7 +28,7 @@ void HwHelperHw::adjustDefaultEngineType(HardwareInfo *pHwInfo) { } template -bool HwHelperHw::isLocalMemoryEnabled(const HardwareInfo &hwInfo) { +bool HwHelperHw::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const { return false; } @@ -39,7 +40,6 @@ void HwHelperHw::setupHardwareCapabilities(HardwareCapabilities *caps, c //Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching.. caps->maxMemAllocSize = (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte); caps->isStatelesToStatefullWithOffsetSupported = true; - caps->localMemorySupported = isLocalMemoryEnabled(hwInfo); } template @@ -167,6 +167,17 @@ const std::vector HwHelperHw::getGpgpuEngineInstances() constexpr std::array gpgpuEngineInstances = {{{ENGINE_RCS, 0}, lowPriorityGpgpuEngine}}; return std::vector(gpgpuEngineInstances.begin(), gpgpuEngineInstances.end()); -}; +} + +template +bool HwHelperHw::getEnableLocalMemory(const HardwareInfo &hwInfo) const { + if (DebugManager.flags.EnableLocalMemory.get() != -1) { + return DebugManager.flags.EnableLocalMemory.get(); + } else if (DebugManager.flags.AUBDumpForceAllToLocalMemory.get()) { + return true; + } + + return OSInterface::osEnableLocalMemory && isLocalMemoryEnabled(hwInfo); +} } // namespace OCLRT diff --git a/runtime/helpers/hw_info.h b/runtime/helpers/hw_info.h index f98629d00e..4e84400fa2 100644 --- a/runtime/helpers/hw_info.h +++ b/runtime/helpers/hw_info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -67,7 +67,6 @@ struct HardwareCapabilities { size_t image3DMaxHeight; uint64_t maxMemAllocSize; bool isStatelesToStatefullWithOffsetSupported; - bool localMemorySupported; }; struct HardwareInfo { diff --git a/runtime/platform/platform.cpp b/runtime/platform/platform.cpp index 4f2de6fb27..96f7dff33e 100644 --- a/runtime/platform/platform.cpp +++ b/runtime/platform/platform.cpp @@ -17,6 +17,7 @@ #include "runtime/helpers/built_ins_helper.h" #include "runtime/helpers/debug_helpers.h" #include "runtime/helpers/get_info.h" +#include "runtime/helpers/hw_helper.h" #include "runtime/helpers/options.h" #include "runtime/helpers/string.h" #include "runtime/os_interface/device_factory.h" @@ -176,7 +177,8 @@ bool Platform::initialize() { CommandStreamReceiverType csrType = this->devices[0]->getDefaultEngine().commandStreamReceiver->getType(); if (csrType != CommandStreamReceiverType::CSR_HW) { - executionEnvironment->initAubCenter(&hwInfo[0], this->devices[0]->getEnableLocalMemory(), "aubfile"); + auto enableLocalMemory = HwHelper::get(hwInfo->pPlatform->eRenderCoreFamily).getEnableLocalMemory(*hwInfo); + executionEnvironment->initAubCenter(&hwInfo[0], enableLocalMemory, "aubfile"); } this->fillGlobalDispatchTable(); diff --git a/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp b/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp index 1acfe7acc0..54425c7187 100644 --- a/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp +++ b/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp @@ -77,13 +77,15 @@ HWTEST_F(AubMemDumpTests, reserveMaxAddress) { aubFile.fileHandle.open(filePath.c_str(), std::ofstream::binary); // Header - auto deviceId = pDevice->getHardwareInfo().capabilityTable.aubDeviceId; + auto hwInfo = pDevice->getHardwareInfo(); + auto deviceId = hwInfo.capabilityTable.aubDeviceId; aubFile.init(AubMemDump::SteppingValues::A, deviceId); auto gAddress = static_cast(-1) - 4096; auto pAddress = static_cast(gAddress) & 0xFFFFFFFF; - OCLRT::AubHelperHw aubHelperHw(pDevice->getEnableLocalMemory()); + auto enableLocalMemory = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily).getEnableLocalMemory(hwInfo); + OCLRT::AubHelperHw aubHelperHw(enableLocalMemory); AUB::reserveAddressPPGTT(aubFile, gAddress, 4096, pAddress, 7, aubHelperHw); aubFile.fileHandle.close(); diff --git a/unit_tests/device/device_caps_tests.cpp b/unit_tests/device/device_caps_tests.cpp index 307e463bf2..f1d8207480 100644 --- a/unit_tests/device/device_caps_tests.cpp +++ b/unit_tests/device/device_caps_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,6 @@ #include "unit_tests/fixtures/device_fixture.h" #include "unit_tests/helpers/debug_manager_state_restore.h" #include "unit_tests/helpers/hw_helper_tests.h" -#include "unit_tests/helpers/variable_backup.h" #include "unit_tests/mocks/mock_builtins.h" #include "unit_tests/mocks/mock_device.h" @@ -879,47 +878,6 @@ TEST(Device_GetCaps, givenDeviceWithNullSourceLevelDebuggerWhenCapsAreInitialize typedef HwHelperTest DeviceCapsWithModifiedHwInfoTest; -TEST_F(DeviceCapsWithModifiedHwInfoTest, GivenLocalMemorySupportedAndOsEnableLocalMemoryAndEnableLocalMemoryDebugVarWhenSetThenGetEnableLocalMemoryReturnCorrectValue) { - DebugManagerStateRestore dbgRestore; - VariableBackup orgOsEnableLocalMemory(&OSInterface::osEnableLocalMemory); - std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(&hwInfoHelper.hwInfo)); - bool orgHwCapsLocalMemorySupported = device->getHardwareCapabilities().localMemorySupported; - - DebugManager.flags.EnableLocalMemory.set(0); - EXPECT_FALSE(device->getEnableLocalMemory()); - - DebugManager.flags.EnableLocalMemory.set(1); - EXPECT_TRUE(device->getEnableLocalMemory()); - - DebugManager.flags.EnableLocalMemory.set(-1); - - device->setHWCapsLocalMemorySupported(false); - OSInterface::osEnableLocalMemory = false; - EXPECT_FALSE(device->getEnableLocalMemory()); - - device->setHWCapsLocalMemorySupported(false); - OSInterface::osEnableLocalMemory = true; - EXPECT_FALSE(device->getEnableLocalMemory()); - - device->setHWCapsLocalMemorySupported(true); - OSInterface::osEnableLocalMemory = false; - EXPECT_FALSE(device->getEnableLocalMemory()); - - device->setHWCapsLocalMemorySupported(true); - OSInterface::osEnableLocalMemory = true; - EXPECT_TRUE(device->getEnableLocalMemory()); - - device->setHWCapsLocalMemorySupported(orgHwCapsLocalMemorySupported); -} - -TEST_F(DeviceCapsWithModifiedHwInfoTest, GivenAUBDumpForceAllToLocalMemoryDebugVarWhenSetThenGetEnableLocalMemoryReturnCorrectValue) { - DebugManagerStateRestore dbgRestore; - std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(&hwInfoHelper.hwInfo)); - - DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true); - EXPECT_TRUE(device->getEnableLocalMemory()); -} - TEST_F(DeviceCapsWithModifiedHwInfoTest, givenPlatformWithSourceLevelDebuggerNotSupportedWhenDeviceIsCreatedThenSourceLevelDebuggerActiveIsSetToFalse) { hwInfoHelper.hwInfo.capabilityTable.sourceLevelDebuggerSupported = false; diff --git a/unit_tests/execution_environment/execution_environment_tests.cpp b/unit_tests/execution_environment/execution_environment_tests.cpp index 017c2bd1fe..53477294e3 100644 --- a/unit_tests/execution_environment/execution_environment_tests.cpp +++ b/unit_tests/execution_environment/execution_environment_tests.cpp @@ -160,11 +160,13 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeAubCenterIsCal } TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeMemoryManagerIsCalledThenLocalMemorySupportedInMemoryManagerHasCorrectValue) { - auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); + const HardwareInfo *hwInfo = platformDevices[0]; + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(hwInfo)); auto executionEnvironment = device->getExecutionEnvironment(); - executionEnvironment->initializeCommandStreamReceiver(platformDevices[0], 0, 0); - executionEnvironment->initializeMemoryManager(false, device->getEnableLocalMemory(), 0, 0); - EXPECT_EQ(device->getEnableLocalMemory(), executionEnvironment->memoryManager->isLocalMemorySupported()); + executionEnvironment->initializeCommandStreamReceiver(hwInfo, 0, 0); + auto enableLocalMemory = HwHelper::get(hwInfo->pPlatform->eRenderCoreFamily).getEnableLocalMemory(*hwInfo); + executionEnvironment->initializeMemoryManager(false, enableLocalMemory, 0, 0); + EXPECT_EQ(enableLocalMemory, executionEnvironment->memoryManager->isLocalMemorySupported()); } TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeMemoryManagerIsCalledThenItIsInitalized) { diff --git a/unit_tests/helpers/hw_helper_default_tests.cpp b/unit_tests/helpers/hw_helper_default_tests.cpp index cac721f210..9380feadea 100644 --- a/unit_tests/helpers/hw_helper_default_tests.cpp +++ b/unit_tests/helpers/hw_helper_default_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,5 +16,4 @@ void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, co EXPECT_EQ(16384u, hwCaps.image3DMaxHeight); EXPECT_EQ(16384u, hwCaps.image3DMaxWidth); EXPECT_TRUE(hwCaps.isStatelesToStatefullWithOffsetSupported); - EXPECT_FALSE(hwCaps.localMemorySupported); } diff --git a/unit_tests/helpers/hw_helper_tests.cpp b/unit_tests/helpers/hw_helper_tests.cpp index afb9bd5cd8..5eaeaf7f4f 100644 --- a/unit_tests/helpers/hw_helper_tests.cpp +++ b/unit_tests/helpers/hw_helper_tests.cpp @@ -12,9 +12,11 @@ #include "runtime/helpers/options.h" #include "runtime/helpers/string.h" #include "runtime/memory_manager/graphics_allocation.h" +#include "runtime/os_interface/os_interface.h" #include "unit_tests/helpers/debug_manager_state_restore.h" #include "unit_tests/helpers/hw_helper_tests.h" #include "unit_tests/helpers/unit_test_helper.h" +#include "unit_tests/helpers/variable_backup.h" #include #include @@ -633,3 +635,32 @@ TEST(HwHelperCacheFlushTest, givenEnableCacheFlushFlagIsReadPlatformSettingWhenP auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); EXPECT_TRUE(HwHelper::cacheFlushAfterWalkerSupported(device->getHardwareInfo())); } + +TEST_F(HwHelperTest, givenEnableLocalMemoryDebugVarAndOsEnableLocalMemoryWhenSetThenGetEnableLocalMemoryReturnsCorrectValue) { + DebugManagerStateRestore dbgRestore; + VariableBackup orgOsEnableLocalMemory(&OSInterface::osEnableLocalMemory); + auto &helper = HwHelper::get(renderCoreFamily); + + DebugManager.flags.EnableLocalMemory.set(0); + EXPECT_FALSE(helper.getEnableLocalMemory(hwInfoHelper.hwInfo)); + + DebugManager.flags.EnableLocalMemory.set(1); + EXPECT_TRUE(helper.getEnableLocalMemory(hwInfoHelper.hwInfo)); + + DebugManager.flags.EnableLocalMemory.set(-1); + + OSInterface::osEnableLocalMemory = false; + EXPECT_FALSE(helper.getEnableLocalMemory(hwInfoHelper.hwInfo)); + + OSInterface::osEnableLocalMemory = true; + EXPECT_EQ(helper.isLocalMemoryEnabled(hwInfoHelper.hwInfo), helper.getEnableLocalMemory(hwInfoHelper.hwInfo)); +} + +TEST_F(HwHelperTest, givenAUBDumpForceAllToLocalMemoryDebugVarWhenSetThenGetEnableLocalMemoryReturnsCorrectValue) { + DebugManagerStateRestore dbgRestore; + std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(&hwInfoHelper.hwInfo)); + auto &helper = HwHelper::get(renderCoreFamily); + + DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true); + EXPECT_TRUE(helper.getEnableLocalMemory(hwInfoHelper.hwInfo)); +} diff --git a/unit_tests/libult/mock_gfx_family.cpp b/unit_tests/libult/mock_gfx_family.cpp index 0e0b7a5c66..4cf82a822a 100644 --- a/unit_tests/libult/mock_gfx_family.cpp +++ b/unit_tests/libult/mock_gfx_family.cpp @@ -69,12 +69,7 @@ size_t HwHelperHw::getMaxBarrierRegisterPerSlice() const { template <> void HwHelperHw::setCapabilityCoherencyFlag(const HardwareInfo *pHwInfo, bool &coherencyFlag) { - PLATFORM *pPlatform = const_cast(pHwInfo->pPlatform); - if (pPlatform->usDeviceID == 20) { - coherencyFlag = false; - } else { - coherencyFlag = true; - } + coherencyFlag = (pHwInfo->pPlatform->usDeviceID != 20); } template <> @@ -82,6 +77,7 @@ bool HwHelperHw::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enab pHwInfo->capabilityTable.whitelistedRegisters.csChicken1_0x2580 = enable; return enable; } + template <> const AubMemDump::LrcaHelper &HwHelperHw::getCsTraits(EngineInstanceT engineInstance) const { return *AUBFamilyMapper::csTraits[engineInstance.type]; diff --git a/unit_tests/mocks/mock_device.cpp b/unit_tests/mocks/mock_device.cpp index 791f1f5180..b5d69ff00f 100644 --- a/unit_tests/mocks/mock_device.cpp +++ b/unit_tests/mocks/mock_device.cpp @@ -7,6 +7,7 @@ #include "unit_tests/mocks/mock_device.h" #include "runtime/device/driver_info.h" +#include "runtime/helpers/hw_helper.h" #include "unit_tests/mocks/mock_memory_manager.h" #include "unit_tests/mocks/mock_ostime.h" #include "unit_tests/tests_configuration.h" @@ -25,8 +26,9 @@ MockDevice::MockDevice(const HardwareInfo &hwInfo) } MockDevice::MockDevice(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex) : Device(hwInfo, executionEnvironment, deviceIndex) { + bool enableLocalMemory = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily).getEnableLocalMemory(hwInfo); bool aubUsage = (testMode == TestMode::AubTests) || (testMode == TestMode::AubTestsWithTbx); - this->mockMemoryManager.reset(new OsAgnosticMemoryManager(false, this->getEnableLocalMemory(), aubUsage, *executionEnvironment)); + this->mockMemoryManager.reset(new OsAgnosticMemoryManager(false, enableLocalMemory, aubUsage, *executionEnvironment)); this->osTime = MockOSTime::create(); mockWaTable = *hwInfo.pWaTable; } @@ -67,7 +69,3 @@ FailDeviceAfterOne::FailDeviceAfterOne(const HardwareInfo &hwInfo, ExecutionEnvi : MockDevice(hwInfo, executionEnvironment, deviceIndex) { this->mockMemoryManager.reset(new FailMemoryManager(1)); } - -void MockDevice::setHWCapsLocalMemorySupported(bool localMemorySupported) { - this->hardwareCapabilities.localMemorySupported = localMemorySupported; -} diff --git a/unit_tests/mocks/mock_device.h b/unit_tests/mocks/mock_device.h index 27fa614055..3364dc39ce 100644 --- a/unit_tests/mocks/mock_device.h +++ b/unit_tests/mocks/mock_device.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,6 @@ extern CommandStreamReceiver *createCommandStream(const HardwareInfo *pHwInfo, E class MockDevice : public Device { public: - using Device::createDeviceImpl; using Device::executionEnvironment; using Device::initializeCaps; @@ -106,8 +105,6 @@ class MockDevice : public Device { } std::unique_ptr mockMemoryManager; - void setHWCapsLocalMemorySupported(bool localMemorySupported); - private: bool forceWhitelistedRegs = false; WhitelistedRegisters mockWhitelistedRegs = {0}; diff --git a/unit_tests/os_interface/linux/hw_info_config_linux_tests.cpp b/unit_tests/os_interface/linux/hw_info_config_linux_tests.cpp index d2e145063a..33eb88f8e8 100644 --- a/unit_tests/os_interface/linux/hw_info_config_linux_tests.cpp +++ b/unit_tests/os_interface/linux/hw_info_config_linux_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,23 +22,22 @@ constexpr uint32_t hwConfigTestMidBatchBit = 1 << 10; template <> int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { - PLATFORM *pPlatform = const_cast(hwInfo->pPlatform); - GT_SYSTEM_INFO *pSysInfo = const_cast(hwInfo->pSysInfo); FeatureTable *pSkuTable = const_cast(hwInfo->pSkuTable); - if (pPlatform->usDeviceID == 30) { + if (hwInfo->pPlatform->usDeviceID == 30) { + GT_SYSTEM_INFO *pSysInfo = const_cast(hwInfo->pSysInfo); pSysInfo->EdramSizeInKb = 128 * 1000; } - if (pPlatform->usDeviceID & hwConfigTestMidThreadBit) { + if (hwInfo->pPlatform->usDeviceID & hwConfigTestMidThreadBit) { pSkuTable->ftrGpGpuMidThreadLevelPreempt = 1; } - if (pPlatform->usDeviceID & hwConfigTestThreadGroupBit) { + if (hwInfo->pPlatform->usDeviceID & hwConfigTestThreadGroupBit) { pSkuTable->ftrGpGpuThreadGroupLevelPreempt = 1; } - if (pPlatform->usDeviceID & hwConfigTestMidBatchBit) { + if (hwInfo->pPlatform->usDeviceID & hwConfigTestMidBatchBit) { pSkuTable->ftrGpGpuMidBatchPreempt = 1; } - return (pPlatform->usDeviceID == 10) ? -1 : 0; + return (hwInfo->pPlatform->usDeviceID == 10) ? -1 : 0; } template <>