mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
fix: stop using LocalOnly flag on Xe2+ platforms
Related-To: NEO-11391 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1cca55624b
commit
32cfa3d497
@@ -451,6 +451,7 @@ TEST_F(GmmLocalMemoryTests, givenUseCompressionAndLocalMemoryInImageInfoTrueWhen
|
|||||||
StorageInfo storageInfo = {};
|
StorageInfo storageInfo = {};
|
||||||
storageInfo.memoryBanks.set(1);
|
storageInfo.memoryBanks.set(1);
|
||||||
storageInfo.systemMemoryPlacement = false;
|
storageInfo.systemMemoryPlacement = false;
|
||||||
|
storageInfo.localOnlyRequired = true;
|
||||||
|
|
||||||
auto gmm = std::make_unique<Gmm>(getGmmHelper(), imgInfo, storageInfo, true);
|
auto gmm = std::make_unique<Gmm>(getGmmHelper(), imgInfo, storageInfo, true);
|
||||||
EXPECT_TRUE(gmm->isCompressionEnabled());
|
EXPECT_TRUE(gmm->isCompressionEnabled());
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ void Gmm::applyMemoryFlags(const StorageInfo &storageInfo) {
|
|||||||
if (extraMemoryFlagsRequired()) {
|
if (extraMemoryFlagsRequired()) {
|
||||||
applyExtraMemoryFlags(storageInfo);
|
applyExtraMemoryFlags(storageInfo);
|
||||||
} else if (!storageInfo.isLockable) {
|
} else if (!storageInfo.isLockable) {
|
||||||
if (isCompressionEnabled() || storageInfo.localOnlyRequired) {
|
if (storageInfo.localOnlyRequired) {
|
||||||
resourceParams.Flags.Info.LocalOnly = 1;
|
resourceParams.Flags.Info.LocalOnly = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "shared/source/memory_manager/allocation_properties.h"
|
#include "shared/source/memory_manager/allocation_properties.h"
|
||||||
#include "shared/source/memory_manager/local_memory_usage.h"
|
#include "shared/source/memory_manager/local_memory_usage.h"
|
||||||
#include "shared/source/memory_manager/memory_manager.h"
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
|
#include "shared/source/release_helper/release_helper.h"
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
@@ -49,6 +50,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
|
|||||||
AppResourceHelper::copyResourceTagStr(storageInfo.resourceTag, properties.allocationType,
|
AppResourceHelper::copyResourceTagStr(storageInfo.resourceTag, properties.allocationType,
|
||||||
sizeof(storageInfo.resourceTag));
|
sizeof(storageInfo.resourceTag));
|
||||||
|
|
||||||
|
auto releaseHelper = executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->getReleaseHelper();
|
||||||
switch (properties.allocationType) {
|
switch (properties.allocationType) {
|
||||||
case AllocationType::constantSurface:
|
case AllocationType::constantSurface:
|
||||||
case AllocationType::kernelIsa:
|
case AllocationType::kernelIsa:
|
||||||
@@ -130,7 +132,9 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
|
|||||||
storageInfo.cloningOfPageTables = false;
|
storageInfo.cloningOfPageTables = false;
|
||||||
storageInfo.tileInstanced = true;
|
storageInfo.tileInstanced = true;
|
||||||
}
|
}
|
||||||
|
if (!releaseHelper || releaseHelper->isLocalOnlyAllowed()) {
|
||||||
storageInfo.localOnlyRequired = true;
|
storageInfo.localOnlyRequired = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (properties.flags.shareable) {
|
if (properties.flags.shareable) {
|
||||||
storageInfo.isLockable = false;
|
storageInfo.isLockable = false;
|
||||||
@@ -140,7 +144,9 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (properties.flags.preferCompressed && (!releaseHelper || releaseHelper->isLocalOnlyAllowed())) {
|
||||||
|
storageInfo.localOnlyRequired = true;
|
||||||
|
}
|
||||||
if (debugManager.flags.ForceMultiTileAllocPlacement.get()) {
|
if (debugManager.flags.ForceMultiTileAllocPlacement.get()) {
|
||||||
UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown);
|
UNRECOVERABLE_IF(properties.allocationType == AllocationType::unknown);
|
||||||
if ((1llu << (static_cast<int64_t>(properties.allocationType) - 1)) & debugManager.flags.ForceMultiTileAllocPlacement.get()) {
|
if ((1llu << (static_cast<int64_t>(properties.allocationType) - 1)) & debugManager.flags.ForceMultiTileAllocPlacement.get()) {
|
||||||
|
|||||||
@@ -593,7 +593,9 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
|||||||
case AllocationType::svmGpu:
|
case AllocationType::svmGpu:
|
||||||
case AllocationType::image:
|
case AllocationType::image:
|
||||||
if (false == allocationData.flags.uncacheable && useLocalPreferredForCacheableBuffers) {
|
if (false == allocationData.flags.uncacheable && useLocalPreferredForCacheableBuffers) {
|
||||||
|
if (!allocationData.flags.preferCompressed) {
|
||||||
allocationData.storageInfo.localOnlyRequired = false;
|
allocationData.storageInfo.localOnlyRequired = false;
|
||||||
|
}
|
||||||
allocationData.storageInfo.systemMemoryPlacement = false;
|
allocationData.storageInfo.systemMemoryPlacement = false;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class ReleaseHelper {
|
|||||||
virtual uint64_t getL3CacheBankSizeInKb() const = 0;
|
virtual uint64_t getL3CacheBankSizeInKb() const = 0;
|
||||||
virtual uint32_t getAdditionalFp16Caps() const = 0;
|
virtual uint32_t getAdditionalFp16Caps() const = 0;
|
||||||
virtual uint32_t getAdditionalExtraCaps() const = 0;
|
virtual uint32_t getAdditionalExtraCaps() const = 0;
|
||||||
|
virtual bool isLocalOnlyAllowed() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ReleaseHelper(HardwareIpVersion hardwareIpVersion) : hardwareIpVersion(hardwareIpVersion) {}
|
ReleaseHelper(HardwareIpVersion hardwareIpVersion) : hardwareIpVersion(hardwareIpVersion) {}
|
||||||
@@ -96,6 +97,7 @@ class ReleaseHelperHw : public ReleaseHelper {
|
|||||||
uint64_t getL3CacheBankSizeInKb() const override;
|
uint64_t getL3CacheBankSizeInKb() const override;
|
||||||
uint32_t getAdditionalFp16Caps() const override;
|
uint32_t getAdditionalFp16Caps() const override;
|
||||||
uint32_t getAdditionalExtraCaps() const override;
|
uint32_t getAdditionalExtraCaps() const override;
|
||||||
|
bool isLocalOnlyAllowed() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ReleaseHelperHw(HardwareIpVersion hardwareIpVersion) : ReleaseHelper(hardwareIpVersion) {}
|
ReleaseHelperHw(HardwareIpVersion hardwareIpVersion) : ReleaseHelper(hardwareIpVersion) {}
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ inline bool ReleaseHelperHw<release>::isAuxSurfaceModeOverrideRequired() const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool ReleaseHelperHw<release>::isLocalOnlyAllowed() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
||||||
#include "shared/source/release_helper/release_helper_common_xe2_hpg.inl"
|
#include "shared/source/release_helper/release_helper_common_xe2_hpg.inl"
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ int ReleaseHelperHw<release>::getProductMaxPreferredSlmSize(int preferredEnumVal
|
|||||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename Xe2HpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
using PREFERRED_SLM_ALLOCATION_SIZE = typename Xe2HpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||||
return std::min(preferredEnumValue, static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K));
|
return std::min(preferredEnumValue, static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool ReleaseHelperHw<release>::isLocalOnlyAllowed() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
||||||
#include "shared/source/release_helper/release_helper_common_xe2_hpg.inl"
|
#include "shared/source/release_helper/release_helper_common_xe2_hpg.inl"
|
||||||
|
|||||||
@@ -147,4 +147,8 @@ uint32_t ReleaseHelperHw<releaseType>::getAdditionalExtraCaps() const {
|
|||||||
return 0u;
|
return 0u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <ReleaseType releaseType>
|
||||||
|
bool ReleaseHelperHw<releaseType>::isLocalOnlyAllowed() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -40,5 +40,6 @@ class MockReleaseHelper : public ReleaseHelper {
|
|||||||
ADDMETHOD_CONST_NOBASE(getL3CacheBankSizeInKb, uint64_t, {}, ());
|
ADDMETHOD_CONST_NOBASE(getL3CacheBankSizeInKb, uint64_t, {}, ());
|
||||||
ADDMETHOD_CONST_NOBASE(getAdditionalFp16Caps, uint32_t, {}, ());
|
ADDMETHOD_CONST_NOBASE(getAdditionalFp16Caps, uint32_t, {}, ());
|
||||||
ADDMETHOD_CONST_NOBASE(getAdditionalExtraCaps, uint32_t, {}, ());
|
ADDMETHOD_CONST_NOBASE(getAdditionalExtraCaps, uint32_t, {}, ());
|
||||||
|
ADDMETHOD_CONST_NOBASE(isLocalOnlyAllowed, bool, {}, ());
|
||||||
};
|
};
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2023 Intel Corporation
|
* Copyright (C) 2018-2024 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -36,6 +36,7 @@ class MockWddmMemoryManager : public MemoryManagerCreate<WddmMemoryManager> {
|
|||||||
using BaseClass::supportsMultiStorageResources;
|
using BaseClass::supportsMultiStorageResources;
|
||||||
using BaseClass::unMapPhysicalToVirtualMemory;
|
using BaseClass::unMapPhysicalToVirtualMemory;
|
||||||
using MemoryManagerCreate<WddmMemoryManager>::MemoryManagerCreate;
|
using MemoryManagerCreate<WddmMemoryManager>::MemoryManagerCreate;
|
||||||
|
using BaseClass::executionEnvironment;
|
||||||
using BaseClass::getHugeGfxMemoryChunkSize;
|
using BaseClass::getHugeGfxMemoryChunkSize;
|
||||||
using BaseClass::getPreferredAllocationMethod;
|
using BaseClass::getPreferredAllocationMethod;
|
||||||
using BaseClass::isStatelessAccessRequired;
|
using BaseClass::isStatelessAccessRequired;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "shared/test/common/mocks/mock_internal_allocation_storage.h"
|
#include "shared/test/common/mocks/mock_internal_allocation_storage.h"
|
||||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||||
#include "shared/test/common/mocks/mock_os_context.h"
|
#include "shared/test/common/mocks/mock_os_context.h"
|
||||||
|
#include "shared/test/common/mocks/mock_release_helper.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
@@ -3011,15 +3012,18 @@ TEST(MemoryManagerTest, givenStorageInfoWithParamsWhenGettingAllocDataForLocalMe
|
|||||||
EXPECT_FALSE(allocData.storageInfo.systemMemoryPlacement);
|
EXPECT_FALSE(allocData.storageInfo.systemMemoryPlacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MemoryManagerTest, givenUseLocalPreferredForCacheableBuffersWhenGettingAllocDataForLocalMemoryThenLocalPreferredSetCorrectly) {
|
HWTEST_F(MemoryAllocatorTest, givenUseLocalPreferredForCacheableBuffersAndCompressionNotPreferredWhenGettingAllocDataForLocalMemoryThenLocalPreferredSetCorrectly) {
|
||||||
// localPreferred is implicit with gmm flags LocalOnly=0 and NonLocalOnly=0
|
// localPreferred is implicit with gmm flags LocalOnly=0 and NonLocalOnly=0
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
debugManager.flags.UseLocalPreferredForCacheableBuffers.set(0);
|
debugManager.flags.UseLocalPreferredForCacheableBuffers.set(0);
|
||||||
AllocationData allocData;
|
AllocationData allocData;
|
||||||
allocData.flags.useSystemMemory = true;
|
allocData.flags.useSystemMemory = true;
|
||||||
|
allocData.flags.preferCompressed = false;
|
||||||
AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield);
|
AllocationProperties properties(mockRootDeviceIndex, 1, AllocationType::buffer, mockDeviceBitfield);
|
||||||
MockMemoryManager mockMemoryManager;
|
MockMemoryManager mockMemoryManager;
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = true;
|
||||||
|
mockMemoryManager.executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
AllocationType shouldUseLocalPreferredAllocationTypes[] = {
|
AllocationType shouldUseLocalPreferredAllocationTypes[] = {
|
||||||
AllocationType::buffer,
|
AllocationType::buffer,
|
||||||
AllocationType::svmGpu,
|
AllocationType::svmGpu,
|
||||||
@@ -3040,7 +3044,6 @@ TEST(MemoryManagerTest, givenUseLocalPreferredForCacheableBuffersWhenGettingAllo
|
|||||||
for (auto allocationType : shouldUseLocalPreferredAllocationTypes) {
|
for (auto allocationType : shouldUseLocalPreferredAllocationTypes) {
|
||||||
properties.allocationType = allocationType;
|
properties.allocationType = allocationType;
|
||||||
auto storageInfo = mockMemoryManager.createStorageInfoFromProperties(properties);
|
auto storageInfo = mockMemoryManager.createStorageInfoFromProperties(properties);
|
||||||
|
|
||||||
mockMemoryManager.getAllocationData(allocData, properties, nullptr, storageInfo);
|
mockMemoryManager.getAllocationData(allocData, properties, nullptr, storageInfo);
|
||||||
EXPECT_EQ(false, allocData.storageInfo.localOnlyRequired);
|
EXPECT_EQ(false, allocData.storageInfo.localOnlyRequired);
|
||||||
EXPECT_EQ(false, allocData.storageInfo.systemMemoryPlacement);
|
EXPECT_EQ(false, allocData.storageInfo.systemMemoryPlacement);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2021-2023 Intel Corporation
|
* Copyright (C) 2021-2024 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "shared/test/common/mocks/mock_device.h"
|
#include "shared/test/common/mocks/mock_device.h"
|
||||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||||
|
#include "shared/test/common/mocks/mock_release_helper.h"
|
||||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
@@ -346,31 +347,82 @@ TEST_F(MultiDeviceStorageInfoTest, givenNonMultiStorageResourceWhenCreatingStora
|
|||||||
|
|
||||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenLocalOnlyFlagIsRequired) {
|
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferThenLocalOnlyFlagIsRequired) {
|
||||||
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask};
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask};
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = true;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MultiDeviceStorageInfoTest, givenReleaseWhichDoesNotAllowLocalOnlyWhenCreatingStorageInfoForBufferThenLocalOnlyFlagIsNotRequired) {
|
||||||
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask};
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = false;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
|
EXPECT_FALSE(storageInfo.localOnlyRequired);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThenLocalOnlyFlagIsRequired) {
|
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForBufferCompressedThenLocalOnlyFlagIsRequired) {
|
||||||
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask};
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask};
|
||||||
properties.flags.preferCompressed = true;
|
properties.flags.preferCompressed = true;
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = true;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MultiDeviceStorageInfoTest, givenReleaseWhichDoesNotAllowLocalOnlyWhenCreatingStorageInfoForBufferCompressedThenLocalOnlyFlagIsNotRequired) {
|
||||||
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::buffer, false, singleTileMask};
|
||||||
|
properties.flags.preferCompressed = true;
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = false;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
|
EXPECT_FALSE(storageInfo.localOnlyRequired);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForSvmGpuThenLocalOnlyFlagIsRequired) {
|
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForSvmGpuThenLocalOnlyFlagIsRequired) {
|
||||||
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask};
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask};
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = true;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MultiDeviceStorageInfoTest, givenReleaseWhichDoesNotAllowLocalOnlyWhenCreatingStorageInfoForSvmGpuThenLocalOnlyFlagIsNotRequired) {
|
||||||
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask};
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = false;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
|
EXPECT_FALSE(storageInfo.localOnlyRequired);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForShareableSvmGpuThenLocalOnlyFlagIsRequiredAndIsNotLocable) {
|
TEST_F(MultiDeviceStorageInfoTest, whenCreatingStorageInfoForShareableSvmGpuThenLocalOnlyFlagIsRequiredAndIsNotLocable) {
|
||||||
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask};
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask};
|
||||||
properties.flags.shareable = 1u;
|
properties.flags.shareable = 1u;
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = true;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
EXPECT_TRUE(storageInfo.localOnlyRequired);
|
||||||
EXPECT_FALSE(storageInfo.isLockable);
|
EXPECT_FALSE(storageInfo.isLockable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MultiDeviceStorageInfoTest, givenReleaseWhichDoesNotAllowLocalOnlyWhenCreatingStorageInfoForShareableSvmGpuThenLocalOnlyFlagIsNotRequiredAndIsNotLocable) {
|
||||||
|
AllocationProperties properties{mockRootDeviceIndex, false, numDevices * MemoryConstants::pageSize64k, AllocationType::svmGpu, false, singleTileMask};
|
||||||
|
properties.flags.shareable = 1u;
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = false;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
|
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||||
|
EXPECT_FALSE(storageInfo.localOnlyRequired);
|
||||||
|
EXPECT_FALSE(storageInfo.isLockable);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenCreatingStorageInfoThenCorrectValuesAreSet) {
|
TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenCreatingStorageInfoThenCorrectValuesAreSet) {
|
||||||
AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::buffer, false, singleTileMask};
|
AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::buffer, false, singleTileMask};
|
||||||
properties.flags.readOnlyMultiStorage = true;
|
properties.flags.readOnlyMultiStorage = true;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "shared/source/execution_environment/execution_environment.h"
|
||||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||||
#include "shared/source/gmm_helper/resource_info.h"
|
#include "shared/source/gmm_helper/resource_info.h"
|
||||||
#include "shared/source/helpers/array_count.h"
|
#include "shared/source/helpers/array_count.h"
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||||
#include "shared/test/common/mocks/mock_os_context.h"
|
#include "shared/test/common/mocks/mock_os_context.h"
|
||||||
#include "shared/test/common/mocks/mock_product_helper.h"
|
#include "shared/test/common/mocks/mock_product_helper.h"
|
||||||
|
#include "shared/test/common/mocks/mock_release_helper.h"
|
||||||
#include "shared/test/common/mocks/windows/mock_wddm_allocation.h"
|
#include "shared/test/common/mocks/windows/mock_wddm_allocation.h"
|
||||||
#include "shared/test/common/os_interface/windows/mock_wddm_memory_manager.h"
|
#include "shared/test/common/os_interface/windows/mock_wddm_memory_manager.h"
|
||||||
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
|
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
|
||||||
@@ -1905,6 +1907,9 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateGraphics
|
|||||||
auto &productHelper = executionEnvironment.rootDeviceEnvironments[0]->getProductHelper();
|
auto &productHelper = executionEnvironment.rootDeviceEnvironments[0]->getProductHelper();
|
||||||
|
|
||||||
memoryManager = std::make_unique<MockWddmMemoryManager>(false, localMemoryEnabled, executionEnvironment);
|
memoryManager = std::make_unique<MockWddmMemoryManager>(false, localMemoryEnabled, executionEnvironment);
|
||||||
|
auto releaseHelper = std::make_unique<MockReleaseHelper>();
|
||||||
|
releaseHelper->isLocalOnlyAllowedResult = true;
|
||||||
|
memoryManager->executionEnvironment.rootDeviceEnvironments[mockRootDeviceIndex]->releaseHelper.reset(releaseHelper.release());
|
||||||
AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmGpu, mockDeviceBitfield};
|
AllocationProperties properties{mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::svmGpu, mockDeviceBitfield};
|
||||||
properties.allFlags = 0;
|
properties.allFlags = 0;
|
||||||
properties.size = MemoryConstants::pageSize;
|
properties.size = MemoryConstants::pageSize;
|
||||||
|
|||||||
@@ -69,3 +69,6 @@ TEST_F(ReleaseHelper1255Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1255Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1255Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper1255Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
|
|||||||
@@ -69,3 +69,6 @@ TEST_F(ReleaseHelper1256Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1256Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1256Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper1256Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -69,3 +69,6 @@ TEST_F(ReleaseHelper1257Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1257Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1257Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper1257Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -51,3 +51,7 @@ TEST_F(ReleaseHelper1260Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1260Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1260Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ReleaseHelper1260Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -50,3 +50,7 @@ TEST_F(ReleaseHelper1261Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1261Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1261Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ReleaseHelper1261Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -84,3 +84,6 @@ TEST_F(ReleaseHelper1270Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1270Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1270Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper1270Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -85,3 +85,6 @@ TEST_F(ReleaseHelper1271Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1271Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1271Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper1271Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -69,3 +69,6 @@ TEST_F(ReleaseHelper1274Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper1274Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper1274Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper1274Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
}
|
||||||
@@ -69,3 +69,7 @@ TEST_F(ReleaseHelper2001Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper2001Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper2001Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ReleaseHelper2001Tests, whenIsLocalOnlyAllowedCalledThenFalseReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenFalseReturned();
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,3 +90,6 @@ TEST_F(ReleaseHelper2004Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||||||
TEST_F(ReleaseHelper2004Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
TEST_F(ReleaseHelper2004Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
}
|
}
|
||||||
|
TEST_F(ReleaseHelper2004Tests, whenIsLocalOnlyAllowedCalledThenFalseReturned) {
|
||||||
|
whenIsLocalOnlyAllowedCalledThenFalseReturned();
|
||||||
|
}
|
||||||
@@ -101,3 +101,23 @@ void ReleaseHelperTestsBase::whenGettingAdditionalExtraKernelCapabilitiesThenRet
|
|||||||
EXPECT_EQ(0u, releaseHelper->getAdditionalExtraCaps());
|
EXPECT_EQ(0u, releaseHelper->getAdditionalExtraCaps());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReleaseHelperTestsBase::whenIsLocalOnlyAllowedCalledThenTrueReturned() {
|
||||||
|
for (auto &revision : getRevisions()) {
|
||||||
|
ipVersion.revision = revision;
|
||||||
|
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||||
|
ASSERT_NE(nullptr, releaseHelper);
|
||||||
|
|
||||||
|
EXPECT_TRUE(releaseHelper->isLocalOnlyAllowed());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReleaseHelperTestsBase::whenIsLocalOnlyAllowedCalledThenFalseReturned() {
|
||||||
|
for (auto &revision : getRevisions()) {
|
||||||
|
ipVersion.revision = revision;
|
||||||
|
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||||
|
ASSERT_NE(nullptr, releaseHelper);
|
||||||
|
|
||||||
|
EXPECT_FALSE(releaseHelper->isLocalOnlyAllowed());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,8 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
|
|||||||
void whenGettingTotalMemBankSizeThenReturn32GB();
|
void whenGettingTotalMemBankSizeThenReturn32GB();
|
||||||
void whenGettingAdditionalFp16AtomicCapabilitiesThenReturnNoCapabilities();
|
void whenGettingAdditionalFp16AtomicCapabilitiesThenReturnNoCapabilities();
|
||||||
void whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
void whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||||
|
void whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||||
|
void whenIsLocalOnlyAllowedCalledThenFalseReturned();
|
||||||
|
|
||||||
virtual std::vector<uint32_t> getRevisions() = 0;
|
virtual std::vector<uint32_t> getRevisions() = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user