fix: set properly resource params when setAllocationType

gmm params: usage, cachable and resource info
should be set properly when override allocation type

Resolves: HSD-22020344331
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2024-08-23 00:02:44 +00:00
committed by Compute-Runtime-Automation
parent 71c6731287
commit 2e0884a301
35 changed files with 201 additions and 129 deletions

View File

@@ -11,8 +11,10 @@
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/memory_pool.h"
#include "shared/source/utilities/logger.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/gtest_helpers.h"
#include "shared/test/common/test_macros/hw_test.h"
#include "shared/test/common/utilities/base_object_utils.h"
#include "gtest/gtest.h"
@@ -493,16 +495,17 @@ TEST(AllocationTypeLoggingSingle, givenGraphicsAllocationTypeWhenConvertingToStr
EXPECT_STREQ(result, "ILLEGAL_VALUE");
}
TEST(AllocationTypeLoggingSingle, givenAllocationTypeWhenConvertingToStringThenSupportAll) {
using AllocationTypeLoggingSingleTest = Test<DeviceFixture>;
HWTEST_F(AllocationTypeLoggingSingleTest, givenAllocationTypeWhenConvertingToStringThenSupportAll) {
std::string testFile = "testfile";
DebugVariables flags;
FullyEnabledFileLogger fileLogger(testFile, flags);
GraphicsAllocation graphicsAllocation(0, 1u /*num gmms*/, AllocationType::unknown, nullptr, 0, 0, MemoryPool::memoryNull, MemoryManager::maxOsContextCount, 0llu);
auto &productHelper = getHelper<NEO::ProductHelper>();
for (uint32_t i = 0; i < static_cast<uint32_t>(AllocationType::count); i++) {
graphicsAllocation.setAllocationType(static_cast<AllocationType>(i));
graphicsAllocation.setAllocationType(static_cast<AllocationType>(i), productHelper);
auto result = getAllocationTypeString(&graphicsAllocation);