From 89fee4add62c7c00a2be2942060f5952f5e1eea8 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Wed, 4 Jun 2025 09:18:53 +0000 Subject: [PATCH] test: fix Gen12AubScratchSpaceForPrivateTest aub test - use USM allocation as destination memory to control lifetime of the object. expectMemory() assumes gpu memory is not released which happens for temporary user pointers gpu allocations Signed-off-by: Mateusz Hoppe --- .../aub_scratch_space_tests_xehp_and_later.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/opencl/test/unit_test/aub_tests/command_queue/aub_scratch_space_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_queue/aub_scratch_space_tests_xehp_and_later.cpp index da90621b53..872f97cabb 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/aub_scratch_space_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/aub_scratch_space_tests_xehp_and_later.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -61,7 +61,7 @@ struct Gen12AubScratchSpaceForPrivateFixture : public KernelAUBFixturecontext, nullptr, expectedMemorySize, 0, &retVal); ASSERT_NE(nullptr, dstBuffer); memset(dstBuffer, 0, expectedMemorySize); @@ -76,9 +76,12 @@ struct Gen12AubScratchSpaceForPrivateFixture : public KernelAUBFixturesetArgSvm(0, expectedMemorySize, dstBuffer, nullptr, 0u); - dstAllocation = createHostPtrAllocationFromSvmPtr(dstBuffer, expectedMemorySize); + const auto svmManager = context->getSVMAllocsManager(); + auto svmData = svmManager->getSVMAlloc(dstBuffer); + auto svmAllocs = &svmData->gpuAllocations; + auto allocId = svmData->getAllocId(); + kernels[kernelIdx]->setArgSvmAlloc(0, dstBuffer, svmAllocs->getDefaultGraphicsAllocation(), allocId); kernels[kernelIdx]->setArgSvm(1, expectedMemorySize, srcBuffer, nullptr, 0u); srcAllocation = createHostPtrAllocationFromSvmPtr(srcBuffer, expectedMemorySize); @@ -99,7 +102,7 @@ struct Gen12AubScratchSpaceForPrivateFixture : public KernelAUBFixturecontext, dstBuffer); dstBuffer = nullptr; }