From 4af5851778397ba74496e9192808cf5b3620748e Mon Sep 17 00:00:00 2001 From: Dominik Dabek Date: Fri, 8 Mar 2024 10:54:24 +0000 Subject: [PATCH] test: add missing compression flag explicit test for xe hpc add missing compression flag to compressed buffer performance hint test Signed-off-by: Dominik Dabek --- .../context/driver_diagnostics_tests.cpp | 2 +- .../mem_obj/buffer_pool_alloc_tests.cpp | 42 ++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp index 72fcd79979..e6c46f8ef0 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp @@ -694,7 +694,7 @@ HWTEST2_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenPrope auto context = std::unique_ptr(Context::create(validProperties, ClDeviceVector(&deviceId, 1), callbackFunction, static_cast(userData), retVal)); auto buffer = std::unique_ptr( Buffer::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()), - 0, 0, size, static_cast(NULL), retVal)); + 0, CL_MEM_COMPRESSED_HINT_INTEL, size, static_cast(NULL), retVal)); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get()); auto &gfxCoreHelper = device->getGfxCoreHelper(); diff --git a/opencl/test/unit_test/mem_obj/buffer_pool_alloc_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_pool_alloc_tests.cpp index d502d82077..a6476d4206 100644 --- a/opencl/test/unit_test/mem_obj/buffer_pool_alloc_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_pool_alloc_tests.cpp @@ -99,7 +99,7 @@ class AggregatedSmallBuffersKernelTest : public AggregatedSmallBuffersTestTempla using AggregatedSmallBuffersDefaultTest = AggregatedSmallBuffersTestTemplate<-1>; -HWTEST2_F(AggregatedSmallBuffersDefaultTest, givenDifferentFlagValuesAndSingleOrMultiDeviceContextWhenCheckIfEnabledThenReturnCorrectValue, IsNotXeHpgCore) { +HWTEST2_F(AggregatedSmallBuffersDefaultTest, givenDifferentFlagValuesAndSingleOrMultiDeviceContextWhenCheckIfEnabledThenReturnCorrectValue, IsBeforeXeHpgCore) { DebugManagerStateRestore restore; // Single device context { @@ -179,6 +179,46 @@ HWTEST2_F(AggregatedSmallBuffersDefaultTest, givenDifferentFlagValuesAndSingleOr context->devices.pop_back(); } +HWTEST2_F(AggregatedSmallBuffersDefaultTest, givenDifferentFlagValuesAndSingleOrMultiDeviceContextWhenCheckIfEnabledThenReturnCorrectValue, IsXeHpcCore) { + DebugManagerStateRestore restore; + // Single device context + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(-1); + EXPECT_FALSE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(0); + EXPECT_FALSE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(1); + EXPECT_TRUE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(2); + EXPECT_TRUE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + // Multi device context + context->devices.push_back(nullptr); + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(-1); + EXPECT_FALSE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(0); + EXPECT_FALSE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(1); + EXPECT_FALSE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + { + debugManager.flags.ExperimentalSmallBufferPoolAllocator.set(2); + EXPECT_TRUE(context->getBufferPoolAllocator().isAggregatedSmallBuffersEnabled(context.get())); + } + context->devices.pop_back(); +} + using AggregatedSmallBuffersDisabledTest = AggregatedSmallBuffersTestTemplate<0>; TEST_F(AggregatedSmallBuffersDisabledTest, givenAggregatedSmallBuffersDisabledWhenBufferCreateCalledThenDoNotUsePool) {