mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Update getAllocationTypeString method
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
e939e97384
commit
abade55c2d
@ -337,6 +337,14 @@ const char *FileLogger<DebugLevel>::getAllocationTypeString(GraphicsAllocation c
|
||||
return "DEBUG_MODULE_AREA";
|
||||
case GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE:
|
||||
return "WORK_PARTITION_SURFACE";
|
||||
case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER:
|
||||
return "GPU_TIMESTAMP_DEVICE_BUFFER";
|
||||
case GraphicsAllocation::AllocationType::RING_BUFFER:
|
||||
return "RING_BUFFER";
|
||||
case GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER:
|
||||
return "SEMAPHORE_BUFFER";
|
||||
case GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY:
|
||||
return "UNIFIED_SHARED_MEMORY";
|
||||
default:
|
||||
return "ILLEGAL_VALUE";
|
||||
}
|
||||
|
@ -926,6 +926,22 @@ TEST(AllocationTypeLoggingSingle, givenGraphicsAllocationTypeWhenConvertingToStr
|
||||
EXPECT_STREQ(result, "ILLEGAL_VALUE");
|
||||
}
|
||||
|
||||
TEST(AllocationTypeLoggingSingle, givenAllocationTypeWhenConvertingToStringThenSupportAll) {
|
||||
std::string testFile = "testfile";
|
||||
DebugVariables flags;
|
||||
FullyEnabledFileLogger fileLogger(testFile, flags);
|
||||
|
||||
GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull);
|
||||
|
||||
for (uint32_t i = 0; i < static_cast<uint32_t>(GraphicsAllocation::AllocationType::COUNT); i++) {
|
||||
graphicsAllocation.setAllocationType(static_cast<GraphicsAllocation::AllocationType>(i));
|
||||
|
||||
auto result = fileLogger.getAllocationTypeString(&graphicsAllocation);
|
||||
|
||||
EXPECT_STRNE(result, "ILLEGAL_VALUE");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(AllocationTypeLoggingSingle, givenDisabledDebugFunctionalityWhenGettingGraphicsAllocationTypeThenNullptrReturned) {
|
||||
std::string testFile = "testfile";
|
||||
DebugVariables flags;
|
||||
|
Reference in New Issue
Block a user