mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
refactor: remove not needed code
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c3794795ec
commit
2039b1c41b
@@ -114,7 +114,7 @@ set(NEO_CORE_HELPERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen_sse4.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}memory_properties_helpers.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers_base.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mt_helpers.h
|
||||
|
||||
@@ -20,7 +20,6 @@ struct AllocationProperties {
|
||||
uint32_t forcePin : 1;
|
||||
uint32_t uncacheable : 1;
|
||||
uint32_t multiOsContextCapable : 1;
|
||||
uint32_t readOnlyMultiStorage : 1;
|
||||
uint32_t shareable : 1;
|
||||
uint32_t resource48Bit : 1;
|
||||
uint32_t isUSMHostAllocation : 1;
|
||||
@@ -29,7 +28,7 @@ struct AllocationProperties {
|
||||
uint32_t forceSystemMemory : 1;
|
||||
uint32_t preferCompressed : 1;
|
||||
uint32_t cantBeReadOnly : 1;
|
||||
uint32_t reserved : 17;
|
||||
uint32_t reserved : 18;
|
||||
} flags;
|
||||
uint32_t allFlags = 0;
|
||||
};
|
||||
|
||||
@@ -128,11 +128,6 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
|
||||
storageInfo.colouringPolicy = colouringPolicy;
|
||||
storageInfo.colouringGranularity = granularity;
|
||||
}
|
||||
if (properties.flags.readOnlyMultiStorage) {
|
||||
storageInfo.readOnlyMultiStorage = true;
|
||||
storageInfo.cloningOfPageTables = false;
|
||||
storageInfo.tileInstanced = true;
|
||||
}
|
||||
if (!releaseHelper || releaseHelper->isLocalOnlyAllowed()) {
|
||||
storageInfo.localOnlyRequired = true;
|
||||
}
|
||||
@@ -222,7 +217,6 @@ DeviceBitfield MemoryManager::computeStorageInfoMemoryBanks(const AllocationProp
|
||||
|
||||
memoryBanks = (forcedMultiStoragePlacement == -1 ? allBanks : forcedMultiStoragePlacement);
|
||||
}
|
||||
memoryBanks = (properties.flags.readOnlyMultiStorage ? allBanks : memoryBanks);
|
||||
break;
|
||||
}
|
||||
case AllocationType::unifiedSharedMemory:
|
||||
|
||||
@@ -28,7 +28,6 @@ struct StorageInfo {
|
||||
bool cloningOfPageTables = true;
|
||||
bool tileInstanced = false;
|
||||
bool multiStorage = false;
|
||||
bool readOnlyMultiStorage = false;
|
||||
bool cpuVisibleSegment = false;
|
||||
bool isLockable = false;
|
||||
bool localOnlyRequired = false;
|
||||
|
||||
@@ -303,34 +303,15 @@ struct GraphicsAllocationTests : public ::testing::Test {
|
||||
}
|
||||
|
||||
void gfxAllocationSetToDefault() {
|
||||
graphicsAllocation.storageInfo.readOnlyMultiStorage = false;
|
||||
graphicsAllocation.storageInfo.memoryBanks = 0;
|
||||
graphicsAllocation.overrideMemoryPool(MemoryPool::memoryNull);
|
||||
}
|
||||
|
||||
void gfxAllocationEnableReadOnlyMultiStorage(uint32_t banks) {
|
||||
graphicsAllocation.storageInfo.cloningOfPageTables = false;
|
||||
graphicsAllocation.storageInfo.readOnlyMultiStorage = true;
|
||||
graphicsAllocation.storageInfo.memoryBanks = banks;
|
||||
graphicsAllocation.overrideMemoryPool(MemoryPool::localMemory);
|
||||
}
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<CommandStreamReceiver> aubCsr;
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
};
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenIsAubWritableIsCalledThenTrueIsReturned) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
|
||||
gfxAllocationSetToDefault();
|
||||
EXPECT_TRUE(aubCsr.isAubWritable(graphicsAllocation));
|
||||
|
||||
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
|
||||
EXPECT_TRUE(aubCsr.isAubWritable(graphicsAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationThatHasPageTablesCloningWhenWriteableFlagsAreUsedThenDefaultBankIsUsed) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
@@ -361,93 +342,6 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationThatHasPageTablesClonin
|
||||
EXPECT_FALSE(aubCsr.isTbxWritable(graphicsAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenAubWritableIsSetToFalseThenAubWritableIsFalse) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
|
||||
gfxAllocationSetToDefault();
|
||||
aubCsr.setAubWritable(false, graphicsAllocation);
|
||||
EXPECT_FALSE(aubCsr.isAubWritable(graphicsAllocation));
|
||||
|
||||
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
|
||||
aubCsr.setAubWritable(false, graphicsAllocation);
|
||||
EXPECT_FALSE(aubCsr.isAubWritable(graphicsAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenMultiStorageGraphicsAllocationWhenAubWritableIsSetOnSpecificBanksThenCorrectValuesAreSet) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
gfxAllocationEnableReadOnlyMultiStorage(0b1010);
|
||||
|
||||
aubCsr.setAubWritable(false, graphicsAllocation);
|
||||
EXPECT_EQ(graphicsAllocation.aubInfo.aubWritable, maxNBitValue(32) & ~(0b1010));
|
||||
|
||||
EXPECT_FALSE(graphicsAllocation.isAubWritable(0b10));
|
||||
EXPECT_FALSE(graphicsAllocation.isAubWritable(0b1000));
|
||||
EXPECT_FALSE(graphicsAllocation.isAubWritable(0b1010));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b100));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b101));
|
||||
|
||||
aubCsr.setAubWritable(true, graphicsAllocation);
|
||||
EXPECT_EQ(graphicsAllocation.aubInfo.aubWritable, maxNBitValue(32));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b10));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b100));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1000));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b101));
|
||||
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1010));
|
||||
}
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenIsTbxWritableIsCalledThenTrueIsReturned) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
|
||||
gfxAllocationSetToDefault();
|
||||
EXPECT_TRUE(aubCsr.isTbxWritable(graphicsAllocation));
|
||||
|
||||
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
|
||||
EXPECT_TRUE(aubCsr.isTbxWritable(graphicsAllocation));
|
||||
};
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenTbxWritableIsSetToFalseThenTbxWritableIsFalse) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
|
||||
gfxAllocationSetToDefault();
|
||||
aubCsr.setTbxWritable(false, graphicsAllocation);
|
||||
EXPECT_FALSE(aubCsr.isTbxWritable(graphicsAllocation));
|
||||
|
||||
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
|
||||
aubCsr.setTbxWritable(false, graphicsAllocation);
|
||||
EXPECT_FALSE(aubCsr.isTbxWritable(graphicsAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(GraphicsAllocationTests, givenMultiStorageGraphicsAllocationWhenTbxWritableIsSetOnSpecificBanksThenCorrectValuesAreSet) {
|
||||
initializeCsr<FamilyType>();
|
||||
auto &aubCsr = getAubCsr<FamilyType>();
|
||||
gfxAllocationEnableReadOnlyMultiStorage(0b1010);
|
||||
|
||||
aubCsr.setTbxWritable(false, graphicsAllocation);
|
||||
EXPECT_EQ(graphicsAllocation.aubInfo.tbxWritable, maxNBitValue(32) & ~(0b1010));
|
||||
|
||||
EXPECT_FALSE(graphicsAllocation.isTbxWritable(0b10));
|
||||
EXPECT_FALSE(graphicsAllocation.isTbxWritable(0b1000));
|
||||
EXPECT_FALSE(graphicsAllocation.isTbxWritable(0b1010));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b100));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b101));
|
||||
|
||||
aubCsr.setTbxWritable(true, graphicsAllocation);
|
||||
EXPECT_EQ(graphicsAllocation.aubInfo.tbxWritable, maxNBitValue(32));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b10));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b100));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1000));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b101));
|
||||
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1010));
|
||||
}
|
||||
|
||||
uint32_t MockGraphicsAllocationTaskCount::getTaskCountCalleedTimes = 0;
|
||||
|
||||
TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenAssignedTaskCountEqualZeroThenPrepareForResidencyDoeNotCallGetTaskCount) {
|
||||
@@ -637,4 +531,4 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsRingBuf
|
||||
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
|
||||
graphicsAllocation.allocationType = AllocationType::ringBuffer;
|
||||
EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,16 +423,6 @@ TEST_F(MultiDeviceStorageInfoTest, givenReleaseWhichDoesNotAllowLocalOnlyWhenCre
|
||||
EXPECT_FALSE(storageInfo.isLockable);
|
||||
}
|
||||
|
||||
TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenCreatingStorageInfoThenCorrectValuesAreSet) {
|
||||
AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::buffer, false, singleTileMask};
|
||||
properties.flags.readOnlyMultiStorage = true;
|
||||
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
|
||||
EXPECT_EQ(allTilesMask, storageInfo.memoryBanks);
|
||||
EXPECT_FALSE(storageInfo.cloningOfPageTables);
|
||||
EXPECT_TRUE(storageInfo.readOnlyMultiStorage);
|
||||
EXPECT_TRUE(storageInfo.tileInstanced);
|
||||
}
|
||||
|
||||
TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenDebugVariableIsSetThenOnlyCertainBanksAreUsed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
auto proposedTiles = allTilesMask;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -84,7 +84,6 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurf
|
||||
EXPECT_EQ(0b1011u, storageInfo.pageTablesVisibility.to_ulong());
|
||||
EXPECT_FALSE(storageInfo.cloningOfPageTables);
|
||||
EXPECT_FALSE(storageInfo.multiStorage);
|
||||
EXPECT_FALSE(storageInfo.readOnlyMultiStorage);
|
||||
EXPECT_TRUE(storageInfo.tileInstanced);
|
||||
EXPECT_TRUE(storageInfo.cpuVisibleSegment);
|
||||
EXPECT_TRUE(storageInfo.isLockable);
|
||||
|
||||
@@ -832,7 +832,6 @@ auto compareStorageInfo = [](const StorageInfo &left, const StorageInfo &right)
|
||||
EXPECT_EQ(left.multiStorage, right.multiStorage);
|
||||
EXPECT_EQ(left.colouringPolicy, right.colouringPolicy);
|
||||
EXPECT_EQ(left.colouringGranularity, right.colouringGranularity);
|
||||
EXPECT_EQ(left.readOnlyMultiStorage, right.readOnlyMultiStorage);
|
||||
EXPECT_EQ(left.cpuVisibleSegment, right.cpuVisibleSegment);
|
||||
EXPECT_EQ(left.isLockable, right.isLockable);
|
||||
EXPECT_EQ(left.localOnlyRequired, right.localOnlyRequired);
|
||||
|
||||
Reference in New Issue
Block a user