mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Split Standard 64KB heap for multiple root devices
Resolves: NEO-4196 Change-Id: Ibd76eb2447791e34ba3e1c27bbc7f5cd09325e98 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
dbd12dbaff
commit
a34268fc54
@@ -3271,7 +3271,7 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedBu
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, DISABLED_givenDrmMemoryManagerAndReleaseGpuRangeIsCalledThenGpuAddressIsDecanonized) {
|
||||
auto mockGfxPartition = std::make_unique<MockGfxPartition>();
|
||||
mockGfxPartition->init(maxNBitValue(48), 0, 0);
|
||||
mockGfxPartition->init(maxNBitValue(48), 0, 0, 1);
|
||||
auto size = 2 * MemoryConstants::megaByte;
|
||||
auto gpuAddress = mockGfxPartition->heapAllocate(HeapIndex::HEAP_STANDARD, size);
|
||||
auto gpuAddressCanonized = GmmHelper::canonize(gpuAddress);
|
||||
|
||||
@@ -1057,7 +1057,7 @@ TEST_F(WddmGfxPartitionTest, initGfxPartition) {
|
||||
ASSERT_FALSE(gfxPartition.heapInitialized(heap));
|
||||
}
|
||||
|
||||
wddm->initGfxPartition(gfxPartition);
|
||||
wddm->initGfxPartition(gfxPartition, 0, 1);
|
||||
|
||||
for (auto heap : MockGfxPartition::allHeapNames) {
|
||||
if (!gfxPartition.heapInitialized(heap)) {
|
||||
@@ -1068,6 +1068,26 @@ TEST_F(WddmGfxPartitionTest, initGfxPartition) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(WddmGfxPartitionTest, initGfxPartitionHeapStandard64KBSplit) {
|
||||
struct MockWddm : public Wddm {
|
||||
using Wddm::gfxPartition;
|
||||
|
||||
MockWddm(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(rootDeviceEnvironment) {}
|
||||
};
|
||||
|
||||
MockWddm wddm(*executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
|
||||
uint32_t rootDeviceIndex = 3;
|
||||
size_t numRootDevices = 5;
|
||||
|
||||
MockGfxPartition gfxPartition;
|
||||
wddm.initGfxPartition(gfxPartition, rootDeviceIndex, numRootDevices);
|
||||
|
||||
auto heapStandard64KBSize = alignDown(wddm.gfxPartition.Standard64KB.Limit - wddm.gfxPartition.Standard64KB.Base + 1, GfxPartition::heapGranularity);
|
||||
EXPECT_EQ(heapStandard64KBSize, gfxPartition.getHeapSize(HeapIndex::HEAP_STANDARD64KB));
|
||||
EXPECT_EQ(wddm.gfxPartition.Standard64KB.Base + rootDeviceIndex * heapStandard64KBSize, gfxPartition.getHeapBase(HeapIndex::HEAP_STANDARD64KB));
|
||||
}
|
||||
|
||||
TEST_F(Wddm20Tests, givenWddmWhenOpenAdapterAndForceDeviceIdIsTheSameAsTheExistingDeviceThenReturnTrue) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.ForceDeviceId.set("1234"); // Existing device Id
|
||||
|
||||
Reference in New Issue
Block a user