diff --git a/opencl/source/utilities/logger.cpp b/opencl/source/utilities/logger.cpp index 71897ce9cf..5b2bae5593 100644 --- a/opencl/source/utilities/logger.cpp +++ b/opencl/source/utilities/logger.cpp @@ -337,6 +337,14 @@ const char *FileLogger::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"; } diff --git a/opencl/test/unit_test/utilities/file_logger_tests.cpp b/opencl/test/unit_test/utilities/file_logger_tests.cpp index 7ffc38374f..e85918e5cb 100644 --- a/opencl/test/unit_test/utilities/file_logger_tests.cpp +++ b/opencl/test/unit_test/utilities/file_logger_tests.cpp @@ -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(GraphicsAllocation::AllocationType::COUNT); i++) { + graphicsAllocation.setAllocationType(static_cast(i)); + + auto result = fileLogger.getAllocationTypeString(&graphicsAllocation); + + EXPECT_STRNE(result, "ILLEGAL_VALUE"); + } +} + TEST(AllocationTypeLoggingSingle, givenDisabledDebugFunctionalityWhenGettingGraphicsAllocationTypeThenNullptrReturned) { std::string testFile = "testfile"; DebugVariables flags;