diff --git a/level_zero/core/test/unit_tests/main.cpp b/level_zero/core/test/unit_tests/main.cpp index 32013666a0..4054f31b50 100644 --- a/level_zero/core/test/unit_tests/main.cpp +++ b/level_zero/core/test/unit_tests/main.cpp @@ -299,8 +299,6 @@ int main(int argc, char **argv) { revId = platform.usRevId; } - NEO::DebugManager.flags.ForcePreferredAllocationMethod.set(0); // Force allocation in system for ULTs - adjustHwInfoForTests(hwInfoForTests, euPerSubSlice, sliceCount, subSlicePerSliceCount, dieRecovery); // Platforms with uninitialized factory are not supported diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index e1bb6cf0ed..8ee822abc3 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -750,10 +750,6 @@ size_t Buffer::calculateHostPtrSize(const size_t *origin, const size_t *region, } bool Buffer::isReadWriteOnCpuAllowed(const Device &device) { - if (!device.getProductHelper().isCachingOnCpuAvailable()) { - return false; - } - if (forceDisallowCPUCopy) { return false; } diff --git a/opencl/source/mem_obj/mem_obj.cpp b/opencl/source/mem_obj/mem_obj.cpp index b90ecc6598..d8ad8950fd 100644 --- a/opencl/source/mem_obj/mem_obj.cpp +++ b/opencl/source/mem_obj/mem_obj.cpp @@ -7,15 +7,12 @@ #include "opencl/source/mem_obj/mem_obj.h" -#include "shared/source/execution_environment/execution_environment.h" -#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gmm_helper/gmm.h" #include "shared/source/gmm_helper/resource_info.h" #include "shared/source/helpers/bit_helpers.h" #include "shared/source/helpers/get_info.h" #include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/memory_manager.h" -#include "shared/source/os_interface/product_helper.h" #include "shared/source/utilities/buffer_pool_allocator.inl" #include "shared/source/utilities/heap_allocator.h" @@ -432,10 +429,8 @@ bool MemObj::isTiledAllocation() const { bool MemObj::mappingOnCpuAllowed() const { auto graphicsAllocation = multiGraphicsAllocation.getDefaultGraphicsAllocation(); - auto &productHelper = this->executionEnvironment->rootDeviceEnvironments[graphicsAllocation->getRootDeviceIndex()]->getProductHelper(); return !isTiledAllocation() && !peekSharingHandler() && !isMipMapped(this) && !DebugManager.flags.DisableZeroCopyForBuffers.get() && - !graphicsAllocation->isCompressionEnabled() && MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool()) && - productHelper.isCachingOnCpuAvailable(); + !graphicsAllocation->isCompressionEnabled() && MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool()); } void MemObj::storeProperties(const cl_mem_properties *properties) { diff --git a/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl b/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl index 6054bfe8f3..b33bba55ac 100644 --- a/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl +++ b/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl @@ -54,8 +54,6 @@ TEST_F(ClEnqueueMapBufferTests, GivenNullCommandQueueWhenMappingBufferThenInvali } TEST_F(ClEnqueueMapBufferTests, GivenValidParametersWhenMappingBufferThenSuccessIsReturned) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pContext->getDevice(0)->getRootDeviceEnvironment()); - unsigned int bufferSize = 16; auto pHostMem = new unsigned char[bufferSize]; memset(pHostMem, 0xaa, bufferSize); @@ -113,8 +111,6 @@ TEST_F(ClEnqueueMapBufferTests, GivenQueueIncapableWhenMappingBufferThenInvalidO } TEST_F(ClEnqueueMapBufferTests, GivenMappedPointerWhenCreatingBufferFromThisPointerThenInvalidHostPtrErrorIsReturned) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pContext->getDevice(0)->getRootDeviceEnvironment()); - unsigned int bufferSize = 16; cl_mem buffer = clCreateBuffer(pContext, CL_MEM_READ_WRITE, bufferSize, nullptr, &retVal); diff --git a/opencl/test/unit_test/api/cl_enqueue_unmap_mem_object_tests.inl b/opencl/test/unit_test/api/cl_enqueue_unmap_mem_object_tests.inl index fe0e3b4572..2d1c7a7505 100644 --- a/opencl/test/unit_test/api/cl_enqueue_unmap_mem_object_tests.inl +++ b/opencl/test/unit_test/api/cl_enqueue_unmap_mem_object_tests.inl @@ -53,8 +53,6 @@ TEST_F(ClEnqueueUnmapMemObjTests, GivenQueueIncapableWhenUnmappingBufferThenInva } TEST_F(ClEnqueueUnmapMemObjTests, givenInvalidAddressWhenUnmappingOnCpuThenReturnError) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pContext->getDevice(0)->getRootDeviceEnvironment()); - auto buffer = std::unique_ptr(BufferHelper>::create(pContext)); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); cl_int retVal = CL_SUCCESS; diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp index c15efb451e..8ef63cb574 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp @@ -15,7 +15,6 @@ #include "shared/test/common/mocks/mock_os_library.h" #include "shared/test/common/mocks/mock_source_level_debugger.h" #include "shared/test/common/mocks/mock_timestamp_container.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "shared/test/common/utilities/base_object_utils.h" #include "opencl/test/unit_test/command_queue/command_queue_fixture.h" @@ -431,8 +430,6 @@ HWTEST_F(CommandQueueHwTest, GivenNonEmptyQueueOnBlockingWhenMappingBufferThenWi bool finishWasCalled; }; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); - MockCmdQ cmdQ(context, pCmdQ->getDevice().getSpecializedDevice()); auto b1 = clCreateBuffer(context, CL_MEM_READ_WRITE, 20, nullptr, nullptr); @@ -479,8 +476,6 @@ HWTEST_F(CommandQueueHwTest, GivenEventsWaitlistOnBlockingWhenMappingBufferThenW uint32_t updateCountBeforeCompleted; }; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); - MockEvent *me = new MockEvent(context, 1024); auto b1 = clCreateBuffer(context, CL_MEM_READ_WRITE, 20, nullptr, nullptr); cl_event meAsClEv = me; diff --git a/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp index a9c4e7c7db..12dba42a3c 100644 --- a/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp @@ -265,8 +265,6 @@ TEST_F(EnqueueMapBufferTest, GivenValidArgsWhenMappingBufferThenSuccessIsReturne } HWTEST_F(EnqueueMapBufferTest, givenNonBlockingReadOnlyMapBufferOnZeroCopyBufferWhenItIsCalledThenSynchronizationIsNotMadeUntilWaitForEvents) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableAsyncEventsHandler.set(false); cl_event mapEventReturned = nullptr; @@ -465,8 +463,6 @@ TEST_F(EnqueueMapBufferTest, givenReadOnlyBufferWhenMappedOnGpuThenSetValidEvent } TEST_F(EnqueueMapBufferTest, givenNonBlockingMapBufferAfterL3IsAlreadyFlushedThenEventIsSignaledAsCompleted) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - cl_event eventReturned = nullptr; uint32_t tagHW = 0; *pTagMemory = tagHW; @@ -534,8 +530,6 @@ TEST_F(EnqueueMapBufferTest, givenNonBlockingMapBufferAfterL3IsAlreadyFlushedThe } HWTEST_F(EnqueueMapBufferTest, GivenBufferThatIsNotZeroCopyWhenNonBlockingMapIsCalledThenFinishIsCalledAndDataTransferred) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - const auto bufferSize = 100; auto localSize = bufferSize; char misaligned[bufferSize] = {1}; @@ -617,8 +611,6 @@ TEST_F(EnqueueMapBufferTest, GivenWrongMemObjectWhenMapIsCalledThenInvalidMemObj } HWTEST_F(EnqueueMapBufferTest, GivenPtrToReturnEventWhenMappingBufferThenEventIsNotNull) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - cl_event eventReturned = NULL; auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); @@ -666,8 +658,6 @@ HWTEST_F(EnqueueMapBufferTest, GivenPtrToReturnEventWhenMappingBufferThenEventIs } TEST_F(EnqueueMapBufferTest, GivenZeroCopyBufferWhenMapBufferWithoutEventsThenCommandStreamReceiverUpdatesRequiredDCFlushCount) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - auto &commandStreamReceiver = pCmdQ->getGpgpuCommandStreamReceiver(); auto buffer = clCreateBuffer( @@ -701,8 +691,6 @@ TEST_F(EnqueueMapBufferTest, GivenZeroCopyBufferWhenMapBufferWithoutEventsThenCo } TEST_F(EnqueueMapBufferTest, givenBufferWithoutUseHostPtrFlagWhenMappedOnCpuThenSetAllMapParams) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - std::unique_ptr buffer(Buffer::create(BufferDefaults::context, CL_MEM_READ_WRITE, 10, nullptr, retVal)); EXPECT_NE(nullptr, buffer); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -732,8 +720,6 @@ TEST_F(EnqueueMapBufferTest, givenBufferWithoutUseHostPtrFlagWhenMappedOnCpuThen } TEST_F(EnqueueMapBufferTest, givenBufferWithUseHostPtrFlagWhenMappedOnCpuThenSetAllMapParams) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - uint8_t hostPtr[10] = {}; std::unique_ptr buffer(Buffer::create(BufferDefaults::context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, 10, hostPtr, retVal)); EXPECT_NE(nullptr, buffer); @@ -764,8 +750,6 @@ TEST_F(EnqueueMapBufferTest, givenBufferWithUseHostPtrFlagWhenMappedOnCpuThenSet } HWTEST_F(EnqueueMapBufferTest, givenMapBufferOnGpuWhenMappingBufferThenStoreGraphicsAllocationInMapInfo) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); - uint8_t hostPtr[10] = {}; std::unique_ptr bufferForCpuMap(Buffer::create(context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, 10, hostPtr, retVal)); ASSERT_NE(nullptr, bufferForCpuMap); diff --git a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp index 7fdd7b0335..de05f583e2 100644 --- a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp @@ -496,7 +496,6 @@ HWTEST_F(EnqueueMapImageTest, GivenPtrToReturnEventWhenMappingImageThenEventIsNo } HWTEST_F(EnqueueMapImageTest, givenZeroCopyImageWhenItIsMappedAndReturnsEventThenEventHasCorrectProperties) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); cl_event eventReturned = nullptr; auto mapFlags = CL_MAP_READ; const size_t origin[3] = {0, 0, 0}; @@ -648,7 +647,6 @@ HWTEST_F(EnqueueMapImageTest, givenSharingHandlerWhenReadOnlyMapAndUnmapOnNonTil } HWTEST_F(EnqueueMapImageTest, givenImageWithouUsetHostPtrFlagWhenMappedOnCpuThenSetAllMapProperties) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); std::unique_ptr image(ImageHelper::create(context)); ASSERT_NE(nullptr, image); EXPECT_TRUE(image->mappingOnCpuAllowed()); @@ -677,7 +675,6 @@ HWTEST_F(EnqueueMapImageTest, givenImageWithouUsetHostPtrFlagWhenMappedOnCpuThen } HWTEST_F(EnqueueMapImageTest, givenImageWithUseHostPtrFlagWhenMappedOnCpuThenSetAllMapProperties) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); std::unique_ptr image(ImageHelper>::create(context)); ASSERT_NE(nullptr, image); EXPECT_TRUE(image->mappingOnCpuAllowed()); @@ -789,7 +786,6 @@ TEST_F(EnqueueMapImageTest, givenBlockedCommandQueueWhenBlockingMapWith1DImageIs } TEST_F(EnqueueMapImageTest, givenBlockedCommandQueueWhenBlockingCpuMapIsCalledThenReturnRowPitchAndSlicePitch) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); const size_t origin[3] = {0, 0, 0}; const size_t region[3] = {1, 1, 1}; size_t retImageRowPitch = 0; @@ -827,7 +823,6 @@ TEST_F(EnqueueMapImageTest, givenBlockedCommandQueueWhenBlockingCpuMapIsCalledTh } TEST_F(EnqueueMapImageTest, givenZeroCopyImageWhenMappedOnCpuThenReturnImageRowAndSlicePitch) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); const size_t origin[3] = {0, 0, 0}; const size_t region[3] = {1, 1, 1}; size_t retImageRowPitch = 0; @@ -847,7 +842,6 @@ TEST_F(EnqueueMapImageTest, givenZeroCopyImageWhenMappedOnCpuThenReturnImageRowA } TEST_F(EnqueueMapImageTest, givenNonZeroCopyImageWhenMappedOnCpuThenReturnHostRowAndSlicePitch) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); const size_t origin[3] = {0, 0, 0}; const size_t region[3] = {1, 1, 1}; size_t retImageRowPitch = 0; @@ -954,8 +948,6 @@ TEST_F(EnqueueMapImageTest, givenImage1DArrayWhenEnqueueMapImageIsCalledThenRetu void transformImage3dTo2dArray(void *memory) override {} }; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); - const size_t origin[3] = {0, 0, 0}; const size_t region[3] = {1, 1, 1}; size_t retImageRowPitch = 0; diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_event_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_event_tests.cpp index 69ae37f9b0..b8f2613ba2 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_event_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_event_tests.cpp @@ -102,7 +102,6 @@ TEST_F(EnqueueReadBuffer, WhenReadingBufferThenEventReturnedShouldBeMaxOfInputEv delete pEvent; } TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndDstPtrEqualSrcPtrWithEventsNotBlockedWhenReadBufferIsExecutedThenTaskLevelShouldNotBeIncreased) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); DebugManagerStateRestore dbgRestore; DebugManager.flags.DoCpuCopyOnReadBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); @@ -180,7 +179,6 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndDstPtr } TEST_F(EnqueueReadBuffer, givenOutOfOrderQueueAndForcedCpuCopyOnReadBufferAndDstPtrEqualSrcPtrWithEventsNotBlockedWhenReadBufferIsExecutedThenTaskLevelShouldNotBeIncreased) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); DebugManagerStateRestore dbgRestore; DebugManager.flags.DoCpuCopyOnReadBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp index 5e21db3b70..8327cfd990 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp @@ -599,7 +599,6 @@ HWTEST_F(EnqueueReadBufferTypeTest, givenEnqueueReadBufferCalledWhenLockedPtrInT } HWTEST_F(EnqueueReadBufferTypeTest, givenForcedCpuCopyWhenEnqueueReadCompressedBufferThenDontCopyOnCpu) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); DebugManagerStateRestore dbgRestore; DebugManager.flags.DoCpuCopyOnReadBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); diff --git a/opencl/test/unit_test/command_queue/enqueue_unmap_memobject_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_unmap_memobject_tests.cpp index 443fb52e31..6566e2bde6 100644 --- a/opencl/test/unit_test/command_queue/enqueue_unmap_memobject_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_unmap_memobject_tests.cpp @@ -119,7 +119,6 @@ TEST_F(EnqueueUnmapMemObjTest, WhenUnmappingMemoryObjectThenReturnedEventHasGrea } HWTEST_F(EnqueueUnmapMemObjTest, WhenUnmappingMemoryObjectThenEventIsUpdated) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); cl_event eventReturned = NULL; auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); @@ -143,7 +142,6 @@ HWTEST_F(EnqueueUnmapMemObjTest, WhenUnmappingMemoryObjectThenEventIsUpdated) { } TEST_F(EnqueueUnmapMemObjTest, WhenUnmappingMemoryObjectThenWaitEventIsUpdated) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); cl_event waitEvent = nullptr; cl_event retEvent = nullptr; @@ -198,7 +196,6 @@ TEST_F(EnqueueUnmapMemObjTest, WhenUnmappingMemoryObjectThenWaitEventIsUpdated) } HWTEST_F(EnqueueUnmapMemObjTest, givenEnqueueUnmapMemObjectWhenNonAubWritableBufferObjectMappedToHostPtrForWritingThenItShouldBeResetToAubAndTbxWritable) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); auto buffer = std::unique_ptr(BufferHelper<>::create()); ASSERT_NE(nullptr, buffer); auto graphicsAllocation = buffer->getGraphicsAllocation(pClDevice->getRootDeviceIndex()); @@ -221,7 +218,6 @@ HWTEST_F(EnqueueUnmapMemObjTest, givenEnqueueUnmapMemObjectWhenNonAubWritableBuf } HWTEST_F(EnqueueUnmapMemObjTest, givenWriteBufferIsServicedOnCPUWhenBufferIsNonAubTbxWriteableThenFlagsChange) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pDevice->getRootDeviceEnvironment()); DebugManagerStateRestore restorer; DebugManager.flags.DoCpuCopyOnWriteBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); diff --git a/opencl/test/unit_test/command_queue/enqueue_write_buffer_event_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_buffer_event_tests.cpp index 08f2acde4c..860aef8886 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_buffer_event_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_buffer_event_tests.cpp @@ -102,7 +102,6 @@ TEST_F(EnqueueWriteBufferTypeTest, WhenWritingBufferThenReturnedEventShouldBeMax } TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBufferAndDstPtrEqualSrcPtrWithEventsNotBlockedWhenWriteBufferIsExecutedThenTaskLevelShouldNotBeIncreased) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); DebugManagerStateRestore dbgRestore; DebugManager.flags.DoCpuCopyOnWriteBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); @@ -218,7 +217,6 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe } TEST_F(EnqueueWriteBufferTypeTest, givenOutOfOrderQueueAndForcedCpuCopyOnWriteBufferAndDstPtrEqualSrcPtrWithEventsWhenWriteBufferIsExecutedThenTaskLevelShouldNotBeIncreased) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); DebugManagerStateRestore dbgRestore; DebugManager.flags.DoCpuCopyOnWriteBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); diff --git a/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp index 8f9b785771..30fa656bc0 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp @@ -428,7 +428,6 @@ HWTEST_F(EnqueueWriteBufferTypeTest, givenEnqueueWriteBufferCalledWhenLockedPtrI } HWTEST_F(EnqueueWriteBufferTypeTest, givenForcedCpuCopyWhenEnqueueWriteCompressedBufferThenDontCopyOnCpu) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); DebugManagerStateRestore dbgRestore; DebugManager.flags.DoCpuCopyOnWriteBuffer.set(1); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); diff --git a/opencl/test/unit_test/command_queue/multiple_map_buffer_tests.cpp b/opencl/test/unit_test/command_queue/multiple_map_buffer_tests.cpp index 145df32333..94c04247eb 100644 --- a/opencl/test/unit_test/command_queue/multiple_map_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/multiple_map_buffer_tests.cpp @@ -8,7 +8,6 @@ #include "shared/test/common/mocks/mock_allocation_properties.h" #include "shared/test/common/mocks/mock_gmm.h" #include "shared/test/common/test_macros/hw_test.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/command_queue/command_queue_hw.h" #include "opencl/source/event/user_event.h" @@ -230,7 +229,6 @@ HWTEST_F(MultipleMapBufferTest, givenErrorFromWriteBufferWhenUnmappedOnGpuThenDo } HWTEST_F(MultipleMapBufferTest, givenUnblockedQueueWhenMappedOnCpuThenAddMappedPtrAndRemoveOnUnmap) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -252,7 +250,6 @@ HWTEST_F(MultipleMapBufferTest, givenUnblockedQueueWhenMappedOnCpuThenAddMappedP } HWTEST_F(MultipleMapBufferTest, givenUnblockedQueueWhenReadOnlyMappedOnCpuThenDontMakeCpuCopy) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -270,7 +267,6 @@ HWTEST_F(MultipleMapBufferTest, givenUnblockedQueueWhenReadOnlyMappedOnCpuThenDo } HWTEST_F(MultipleMapBufferTest, givenUnblockedQueueWhenWriteInvalidateMappedOnCpuThenDontMakeCpuCopy) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -288,7 +284,6 @@ HWTEST_F(MultipleMapBufferTest, givenUnblockedQueueWhenWriteInvalidateMappedOnCp } HWTEST_F(MultipleMapBufferTest, givenBlockedQueueWhenMappedOnCpuThenAddMappedPtrAndRemoveOnUnmap) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -316,7 +311,6 @@ HWTEST_F(MultipleMapBufferTest, givenBlockedQueueWhenMappedOnCpuThenAddMappedPtr } HWTEST_F(MultipleMapBufferTest, givenBlockedQueueWhenMappedReadOnlyOnCpuThenDontMakeCpuCopy) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -340,7 +334,6 @@ HWTEST_F(MultipleMapBufferTest, givenBlockedQueueWhenMappedReadOnlyOnCpuThenDont } HWTEST_F(MultipleMapBufferTest, givenInvalidPtrWhenUnmappedOnCpuThenReturnError) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -408,7 +401,6 @@ HWTEST_F(MultipleMapBufferTest, givenOverlapingPtrWhenMappingOnGpuForWriteThenRe } HWTEST_F(MultipleMapBufferTest, givenOverlapingPtrWhenMappingOnCpuForWriteThenReturnError) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto buffer = createMockBuffer(false); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(buffer->mappingOnCpuAllowed()); @@ -426,9 +418,3 @@ HWTEST_F(MultipleMapBufferTest, givenOverlapingPtrWhenMappingOnCpuForWriteThenRe EXPECT_EQ(CL_INVALID_OPERATION, retVal); EXPECT_EQ(1u, buffer->getMapOperationsHandler().size()); } - -HWTEST_F(MultipleMapBufferTest, givenCachingOnCpuUnavailableWhenMappingOnCpuAllowedIsCalledThenReturnFalse) { - auto buffer = createMockBuffer(false); - auto &productHelper = pClDevice->getRootDeviceEnvironment().getHelper(); - EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), buffer->mappingOnCpuAllowed()); -} diff --git a/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp b/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp index 416ac89026..50be5803c7 100644 --- a/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp @@ -8,7 +8,6 @@ #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/test_macros/test.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/command_queue/command_queue_hw.h" #include "opencl/source/event/user_event.h" @@ -266,7 +265,6 @@ HWTEST_F(MultipleMapImageTest, givenErrorFromWriteImageWhenUnmappedOnGpuThenDont } HWTEST_F(MultipleMapImageTest, givenUnblockedQueueWhenMappedOnCpuThenAddMappedPtrAndRemoveOnUnmap) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); image->isZeroCopy = false; @@ -289,7 +287,6 @@ HWTEST_F(MultipleMapImageTest, givenUnblockedQueueWhenMappedOnCpuThenAddMappedPt } HWTEST_F(MultipleMapImageTest, givenUnblockedQueueWhenReadOnlyUnmappedOnCpuThenDontMakeCpuCopy) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); image->isZeroCopy = false; @@ -311,7 +308,6 @@ HWTEST_F(MultipleMapImageTest, givenUnblockedQueueWhenReadOnlyUnmappedOnCpuThenD } HWTEST_F(MultipleMapImageTest, givenUnblockedQueueWhenWriteInvalidateMappedOnCpuThenDontMakeCpuCopy) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); image->isZeroCopy = false; @@ -333,7 +329,6 @@ HWTEST_F(MultipleMapImageTest, givenUnblockedQueueWhenWriteInvalidateMappedOnCpu } HWTEST_F(MultipleMapImageTest, givenBlockedQueueWhenMappedOnCpuThenAddMappedPtrAndRemoveOnUnmap) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); image->isZeroCopy = false; @@ -363,7 +358,6 @@ HWTEST_F(MultipleMapImageTest, givenBlockedQueueWhenMappedOnCpuThenAddMappedPtrA } HWTEST_F(MultipleMapImageTest, givenBlockedQueueWhenMappedReadOnlyOnCpuThenDontMakeCpuCopy) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); image->isZeroCopy = false; @@ -391,7 +385,6 @@ HWTEST_F(MultipleMapImageTest, givenBlockedQueueWhenMappedReadOnlyOnCpuThenDontM } HWTEST_F(MultipleMapImageTest, givenInvalidPtrWhenUnmappedOnCpuThenReturnError) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(image->mappingOnCpuAllowed()); @@ -460,7 +453,6 @@ HWTEST_F(MultipleMapImageTest, givenOverlapingPtrWhenMappingForWriteThenReturnEr } HWTEST_F(MultipleMapImageTest, givenOverlapingPtrWhenMappingOnCpuForWriteThenReturnError) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); auto image = createMockImage(); auto cmdQ = createMockCmdQ(); EXPECT_TRUE(image->mappingOnCpuAllowed()); diff --git a/opencl/test/unit_test/command_queue/read_write_buffer_cpu_copy.cpp b/opencl/test/unit_test/command_queue/read_write_buffer_cpu_copy.cpp index cea0592fe0..47b325991a 100644 --- a/opencl/test/unit_test/command_queue/read_write_buffer_cpu_copy.cpp +++ b/opencl/test/unit_test/command_queue/read_write_buffer_cpu_copy.cpp @@ -11,7 +11,6 @@ #include "shared/source/memory_manager/memory_allocation.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/test_macros/test.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/test/unit_test/command_queue/enqueue_read_buffer_fixture.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" @@ -21,7 +20,6 @@ using namespace NEO; typedef EnqueueReadBufferTypeTest ReadWriteBufferCpuCopyTest; HWTEST_F(ReadWriteBufferCpuCopyTest, givenCompressedGmmWhenAskingForCpuOperationThenDisallow) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); DebugManagerStateRestore restorer; DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); cl_int retVal; @@ -46,7 +44,6 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, givenCompressedGmmWhenAskingForCpuOperation } HWTEST_F(ReadWriteBufferCpuCopyTest, GivenUnalignedReadPtrWhenReadingBufferThenMemoryIsReadCorrectly) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); DebugManagerStateRestore restorer; DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); cl_int retVal; @@ -88,7 +85,6 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, GivenUnalignedReadPtrWhenReadingBufferThenM } HWTEST_F(ReadWriteBufferCpuCopyTest, GivenUnalignedSrcPtrWhenWritingBufferThenMemoryIsWrittenCorrectly) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); DebugManagerStateRestore restorer; DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); cl_int retVal; @@ -230,7 +226,6 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, GivenSpecificMemoryStructuresWhenReadingWri } HWTEST_F(ReadWriteBufferCpuCopyTest, givenDebugVariableToDisableCpuCopiesWhenBufferCpuCopyAllowedIsCalledThenItReturnsFalse) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); DebugManagerStateRestore restorer; DebugManager.flags.EnableLocalMemory.set(false); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); @@ -257,13 +252,6 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, givenDebugVariableToDisableCpuCopiesWhenBuf EXPECT_FALSE(mockCommandQueue->bufferCpuCopyAllowed(buffer.get(), CL_COMMAND_WRITE_BUFFER, true, MemoryConstants::pageSize, reinterpret_cast(0x1000), 0u, nullptr)); } -HWTEST_F(ReadWriteBufferCpuCopyTest, givenCachingOnCpuUnavailableWhenIsReadWriteOnCpuAllowedThenReturnFalse) { - cl_int retVal; - std::unique_ptr buffer(Buffer::create(context, CL_MEM_ALLOC_HOST_PTR, MemoryConstants::pageSize, nullptr, retVal)); - auto &productHelper = context->getDevice(0)->getRootDeviceEnvironment().getHelper(); - EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), buffer->isReadWriteOnCpuAllowed(context->getDevice(0)->getDevice())); -} - TEST(ReadWriteBufferOnCpu, givenNoHostPtrAndAlignedSizeWhenMemoryAllocationIsInNonSystemMemoryPoolThenIsReadWriteOnCpuAllowedReturnsFalse) { DebugManagerStateRestore restorer; DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); @@ -271,7 +259,6 @@ TEST(ReadWriteBufferOnCpu, givenNoHostPtrAndAlignedSizeWhenMemoryAllocationIsInN MockMemoryManager *memoryManager = new MockMemoryManager(*executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); auto device = std::make_unique(MockDevice::createWithExecutionEnvironment(nullptr, executionEnvironment, 0u)); - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(device->getRootDeviceEnvironment()); MockContext ctx(device.get()); @@ -296,7 +283,6 @@ TEST(ReadWriteBufferOnCpu, givenPointerThatRequiresCpuCopyWhenCpuCopyIsEvaluated MockMemoryManager *memoryManager = new MockMemoryManager(*executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); auto device = std::make_unique(MockDevice::createWithExecutionEnvironment(nullptr, executionEnvironment, 0u)); - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(device->getRootDeviceEnvironment()); MockContext context(device.get()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 5d1b77ae1a..f21ff1d6ad 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -22,7 +22,6 @@ #include "shared/test/common/mocks/mock_gmm_page_table_mngr.h" #include "shared/test/common/mocks/mock_submissions_aggregator.h" #include "shared/test/common/test_macros/hw_test.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" @@ -228,7 +227,6 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenNonDcFlushWithInitialTaskCoun } HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenDcFlushWhenFinishingThenTaskCountIncremented) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(pClDevice->getRootDeviceEnvironment()); MockContext ctx(pClDevice); MockKernelWithInternals kernel(*pClDevice); MockCommandQueueHw mockCmdQueue(&ctx, pClDevice, nullptr); diff --git a/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp index ffa9895897..63b2ac34ef 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp @@ -8,7 +8,6 @@ #include "shared/source/helpers/local_work_size.h" #include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/command_queue/cl_local_work_size.h" #include "opencl/source/command_queue/command_queue.h" @@ -452,7 +451,6 @@ TEST_F(PerformanceHintEnqueueImageTest, GivenNonBlockingReadImageSharesStorageWi } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueMapBufferIsCallingThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); Buffer *buffer; void *address; @@ -477,7 +475,6 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueMapBufferIsCal delete buffer; } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagAndBlockingEventWhenEnqueueMapBufferIsCallingThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); void *address; bool zeroCopyBuffer = GetParam(); @@ -508,7 +505,6 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagAndBlockingEventWhenEnque } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueMapImageIsCallingThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); Image *image; bool isZeroCopyImage; @@ -547,7 +543,6 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueMapImageIsCall } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagAndBlockingEventWhenEnqueueMapImageIsCallingThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); auto image = std::unique_ptr(ImageHelper>::create(context)); bool isZeroCopyImage = GetParam(); @@ -586,7 +581,6 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagAndBlockingEventWhenEnque } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueUnmapIsCallingWithBufferThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); Buffer *buffer; void *address; @@ -613,7 +607,6 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueUnmapIsCalling } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyAndBlockedEventFlagWhenEnqueueUnmapIsCallingWithBufferThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); void *address; bool zeroCopyBuffer = GetParam(); @@ -645,7 +638,6 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyAndBlockedEventFlagWhenEnqueu } TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueUnmapIsCallingWithImageThenContextProvidesProperHint) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context->getDevice(0)->getRootDeviceEnvironment()); Image *image; bool isZeroCopyImage; diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 8295666230..79e5dc6052 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -1488,7 +1488,6 @@ TEST_F(EventTest, givenCmdQueueWithoutProfilingWhenIsCpuProfilingIsCalledThenFal } TEST_F(EventTest, givenOutEventWhenBlockingEnqueueHandledOnCpuThenUpdateTaskCountAndFlushStampFromCmdQ) { - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(mockContext.getDevice(0)->getRootDeviceEnvironment()); std::unique_ptr image(ImageHelper::create(&mockContext)); EXPECT_TRUE(image->mappingOnCpuAllowed()); diff --git a/opencl/test/unit_test/main.cpp b/opencl/test/unit_test/main.cpp index 17908661a4..395b9a4227 100644 --- a/opencl/test/unit_test/main.cpp +++ b/opencl/test/unit_test/main.cpp @@ -276,8 +276,6 @@ int main(int argc, char **argv) { revId = platform.usRevId; } - NEO::DebugManager.flags.ForcePreferredAllocationMethod.set(0); // Force allocation in system for ULTs - adjustHwInfoForTests(hwInfoForTests, euPerSubSlice, sliceCount, subSlicePerSliceCount, dieRecovery); binaryNameSuffix.append(hardwarePrefix[hwInfoForTests.platform.eProductFamily]); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index ac6ff8d616..bafccafead 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -26,7 +26,6 @@ #include "shared/test/common/mocks/mock_host_ptr_manager.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/common/test_macros/hw_test.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/extensions/public/cl_ext_private.h" #include "opencl/source/command_queue/command_queue_hw.h" @@ -78,7 +77,6 @@ TEST(Buffer, whenBufferAllocatedInLocalMemoryThenCpuCopyIsDisallowed) { MockBuffer buffer(allocation); UltDeviceFactory factory{1, 0}; auto &device = *factory.rootDevices[0]; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(factory.rootDevices[0]->getRootDeviceEnvironment()); allocation.memoryPool = MemoryPool::LocalMemory; EXPECT_FALSE(buffer.isReadWriteOnCpuAllowed(device)); diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index 39d34b3391..1db6d76119 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -1298,7 +1298,6 @@ TEST(ImageTest, givenImageWhenAskedForPtrOffsetForCpuMappingThenReturnCorrectVal DebugManagerStateRestore restore; DebugManager.flags.ForceLinearImages.set(true); MockContext ctx; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(ctx.getDevice(0)->getRootDeviceEnvironment()); std::unique_ptr image(ImageHelper::create(&ctx)); EXPECT_TRUE(image->mappingOnCpuAllowed()); @@ -1314,7 +1313,6 @@ TEST(ImageTest, givenImageWhenAskedForPtrOffsetForCpuMappingThenReturnCorrectVal TEST(ImageTest, given1DArrayImageWhenAskedForPtrOffsetForMappingThenReturnCorrectValue) { MockContext ctx; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(ctx.getDevice(0)->getRootDeviceEnvironment()); std::unique_ptr image(ImageHelper::create(&ctx)); MemObjOffsetArray origin = {{4, 5, 0}}; @@ -1347,7 +1345,6 @@ TEST(ImageTest, givenImageWhenAskedForPtrLengthForCpuMappingThenReturnCorrectVal DebugManagerStateRestore restore; DebugManager.flags.ForceLinearImages.set(true); MockContext ctx; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(ctx.getDevice(0)->getRootDeviceEnvironment()); std::unique_ptr image(ImageHelper::create(&ctx)); EXPECT_TRUE(image->mappingOnCpuAllowed()); diff --git a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp index 4f02e12525..25f3dfdb00 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp @@ -16,7 +16,6 @@ #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/mock_memory_manager.h" -#include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/properties_helper.h" @@ -302,23 +301,15 @@ TEST(MemObj, givenTiledObjectWhenAskedForCpuMappingThenReturnFalse) { bool isTiledAllocation() const override { return true; } }; MockContext context; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context.getDevice(0)->getRootDeviceEnvironment()); - MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); - - context.memoryManager = &memoryManager; - - auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); - allocation->setDefaultGmm(new Gmm(context.getDevice(0)->getGmmHelper(), nullptr, MemoryConstants::pageSize, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true)); auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); - MyMemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, - MemoryConstants::pageSize, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false); + MyMemObj memObj(nullptr, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, + MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false); EXPECT_FALSE(memObj.mappingOnCpuAllowed()); } TEST(MemObj, givenCompressedGmmWhenAskingForMappingOnCpuThenDisallow) { MockContext context; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context.getDevice(0)->getRootDeviceEnvironment()); MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; @@ -337,7 +328,6 @@ TEST(MemObj, givenCompressedGmmWhenAskingForMappingOnCpuThenDisallow) { TEST(MemObj, givenDefaultWhenAskedForCpuMappingThenReturnTrue) { MockContext context; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context.getDevice(0)->getRootDeviceEnvironment()); MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; @@ -354,7 +344,6 @@ TEST(MemObj, givenDefaultWhenAskedForCpuMappingThenReturnTrue) { TEST(MemObj, givenNonCpuAccessibleMemoryWhenAskingForMappingOnCpuThenDisallow) { MockContext context; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(context.getDevice(0)->getRootDeviceEnvironment()); MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); context.memoryManager = &memoryManager; diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index 8fa7d58c9e..e4a4b8e2c0 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -1130,7 +1130,6 @@ TEST(UnifiedSharedMemoryTransferCalls, givenHostUsmAllocationWhenPtrIsUsedForTra DebugManager.flags.EnableLocalMemory.set(false); DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast(LocalMemoryAccessMode::Default)); MockContext mockContext; - REQUIRE_CPU_MEM_ACCESS_OR_SKIP(mockContext.getDevice(0)->getRootDeviceEnvironment()); cl_context clContext = &mockContext; if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) { diff --git a/opencl/test/unit_test/offline_compiler/main.cpp b/opencl/test/unit_test/offline_compiler/main.cpp index 824ba53101..6d521c94cc 100644 --- a/opencl/test/unit_test/offline_compiler/main.cpp +++ b/opencl/test/unit_test/offline_compiler/main.cpp @@ -149,8 +149,6 @@ int main(int argc, char **argv) { } } - NEO::DebugManager.flags.ForcePreferredAllocationMethod.set(0); // Force allocation in system for ULTs - auto productConfigHelper = new ProductConfigHelper(); auto allEnabledDeviceConfigs = productConfigHelper->getDeviceAotInfo(); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 1fc5c5d926..c39a565291 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -504,7 +504,7 @@ DECLARE_DEBUG_VARIABLE(bool, SkipFlushingEventsOnGetStatusCalls, false, "When se DECLARE_DEBUG_VARIABLE(bool, AllowUnrestrictedSize, false, "Allow allocating memory with greater size than MAX_MEM_ALLOC_SIZE") DECLARE_DEBUG_VARIABLE(bool, ForceDefaultThreadArbitrationPolicyIfNotSpecified, false, "When executing kernel without thread arbitration hint specified, ensure the default setting is used") DECLARE_DEBUG_VARIABLE(bool, ForceAllResourcesUncached, false, "When set, all memory operations for all resources are forced to UC. This overrides all caching-related debug variables and globally disables all caches") -DECLARE_DEBUG_VARIABLE(bool, EnableCpuCacheForResources, false, "When true, driver will set gmm flag cacheable related to caching on cpu, for resources where it is allowed") +DECLARE_DEBUG_VARIABLE(bool, EnableCpuCacheForResources, true, "When true, driver will set gmm flag cacheable related to caching on cpu, for resources where it is allowed") DECLARE_DEBUG_VARIABLE(bool, EnableDebuggerMmapMemoryAccess, false, "Mmap used to access memory by debug api, valid only on Linux OS") DECLARE_DEBUG_VARIABLE(bool, ForceDefaultGrfCompilationMode, false, "Adds build option -cl-intel-128-GRF-per-thread to force kernel compilation in Default-GRF mode") DECLARE_DEBUG_VARIABLE(bool, ForceLargeGrfCompilationMode, false, "Adds build option -cl-intel-256-GRF-per-thread to force kernel compilation in Large-GRF mode") diff --git a/shared/source/os_interface/windows/max_chunk_size_wddm.cpp b/shared/source/os_interface/windows/max_chunk_size_wddm.cpp index d4a0de8ff2..efc470ee7f 100644 --- a/shared/source/os_interface/windows/max_chunk_size_wddm.cpp +++ b/shared/source/os_interface/windows/max_chunk_size_wddm.cpp @@ -9,7 +9,7 @@ namespace NEO { -const GfxMemoryAllocationMethod preferredAllocationMethod = GfxMemoryAllocationMethod::AllocateByKmd; +const GfxMemoryAllocationMethod preferredAllocationMethod = GfxMemoryAllocationMethod::UseUmdSystemPtr; size_t WddmMemoryManager::getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod allocationMethod) const { return 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k; diff --git a/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h b/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h index cd5aa202b8..f200b19b53 100644 --- a/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h +++ b/shared/test/common/os_interface/windows/mock_wddm_memory_manager.h @@ -52,7 +52,7 @@ class MockWddmMemoryManager : public MemoryManagerCreate { return BaseClass::allocateGraphicsMemoryInDevicePool(allocationData, status); } - size_t hugeGfxMemoryChunkSize = BaseClass::getHugeGfxMemoryChunkSize(MockWddmMemoryManager::getPreferredAllocationMethod()); + size_t hugeGfxMemoryChunkSize = BaseClass::getHugeGfxMemoryChunkSize(preferredAllocationMethod); size_t getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod allocationMethod) const override { return hugeGfxMemoryChunkSize; } MockWddmMemoryManager(ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, false, executionEnvironment) { diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 881d1ef0e8..bc01bbbfac 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -532,7 +532,7 @@ ExitOnSubmissionMode = 0 ForceInOrderImmediateCmdListExecution = -1 ForceTlbFlush = -1 DebugSetMemoryDiagnosticsDelay = -1 -EnableCpuCacheForResources = 0 +EnableCpuCacheForResources = 1 OverrideHwIpVersion = -1 PrintGlobalTimestampInNs = 0 EnableDeviceStateVerification = -1 diff --git a/shared/test/common/test_macros/test_checks_shared.cpp b/shared/test/common/test_macros/test_checks_shared.cpp index 7aabd6aea5..d9ab3b2342 100644 --- a/shared/test/common/test_macros/test_checks_shared.cpp +++ b/shared/test/common/test_macros/test_checks_shared.cpp @@ -55,9 +55,4 @@ bool TestChecks::supportsSvm(const std::unique_ptr &pHardwareInfo) } bool TestChecks::supportsSvm(const Device *pDevice) { return supportsSvm(&pDevice->getHardwareInfo()); -} - -bool TestChecks::supportsCpuMemAccess(const RootDeviceEnvironment &rootDeviceEnvironment) { - auto &productHelper = rootDeviceEnvironment.getHelper(); - return productHelper.isCachingOnCpuAvailable(); } \ No newline at end of file diff --git a/shared/test/common/test_macros/test_checks_shared.h b/shared/test/common/test_macros/test_checks_shared.h index 15f125059a..c656088716 100644 --- a/shared/test/common/test_macros/test_checks_shared.h +++ b/shared/test/common/test_macros/test_checks_shared.h @@ -18,7 +18,6 @@ struct RootDeviceEnvironment; namespace TestChecks { bool supportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment); bool fullySupportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment); -bool supportsCpuMemAccess(const RootDeviceEnvironment &rootDeviceEnvironment); bool supportsImages(const HardwareInfo &hardwareInfo); bool supportsImages(const std::unique_ptr &pHardwareInfo); bool supportsSvm(const HardwareInfo *pHardwareInfo); @@ -57,8 +56,3 @@ bool supportsSvm(const Device *pDevice); if (NEO::TestChecks::supportsImages(param) == false) { \ GTEST_SKIP(); \ } - -#define REQUIRE_CPU_MEM_ACCESS_OR_SKIP(rootDeviceEnvironment) \ - if (NEO::TestChecks::supportsCpuMemAccess(rootDeviceEnvironment) == false) { \ - GTEST_SKIP(); \ - } diff --git a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp index 2fcbd5a2fc..b60438979b 100644 --- a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -748,9 +748,6 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenInitializeEngineIs } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenInitFileIsCalledThenMemTraceCommentWithDriverVersionIsPutIntoAubStream) { - DebugManagerStateRestore stateRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); - auto mockAubManager = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(false, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); @@ -989,7 +986,6 @@ HWTEST_F(AubFileStreamTests, givenGenerateAubFilePerProcessIdDebugFlagAndAubComm HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenInitFileIsCalledThenCommentWithNonDefaultFlagsAreAdded) { DebugManagerStateRestore stateRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); DebugManager.flags.MakeAllBuffersResident.set(1); DebugManager.flags.ZE_AFFINITY_MASK.set("non-default"); diff --git a/shared/test/unit_test/execution_environment/execution_environment_tests.cpp b/shared/test/unit_test/execution_environment/execution_environment_tests.cpp index c793211dc7..e4aca5c707 100644 --- a/shared/test/unit_test/execution_environment/execution_environment_tests.cpp +++ b/shared/test/unit_test/execution_environment/execution_environment_tests.cpp @@ -193,9 +193,6 @@ TEST(ExecutionEnvironment, givenNeoCalEnabledWhenCreateExecutionEnvironmentThenS {"UseKmdMigration", 0}, {"SplitBcsSize", 256}}; - DebugManagerStateRestore restorer; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); - #undef DECLARE_DEBUG_VARIABLE #define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \ EXPECT_EQ(defaultValue, DebugManager.flags.variableName.getRef()); @@ -206,6 +203,7 @@ TEST(ExecutionEnvironment, givenNeoCalEnabledWhenCreateExecutionEnvironmentThenS #undef DECLARE_DEBUG_VARIABLE + DebugManagerStateRestore restorer; DebugManager.flags.NEO_CAL_ENABLED.set(1); ExecutionEnvironment exeEnv; diff --git a/shared/test/unit_test/main.cpp b/shared/test/unit_test/main.cpp index 09b1051356..092703d8d0 100644 --- a/shared/test/unit_test/main.cpp +++ b/shared/test/unit_test/main.cpp @@ -304,8 +304,6 @@ int main(int argc, char **argv) { revId = platform.usRevId; } - NEO::DebugManager.flags.ForcePreferredAllocationMethod.set(0); // Force allocation in system for ULTs - adjustHwInfoForTests(hwInfoForTests, euPerSubSlice, sliceCount, subSlicePerSliceCount, dieRecovery); binaryNameSuffix.append(hardwarePrefix[hwInfoForTests.platform.eProductFamily]); diff --git a/shared/test/unit_test/os_interface/wddm_linux/configure_device_address_space_drm_or_wddm_test.cpp b/shared/test/unit_test/os_interface/wddm_linux/configure_device_address_space_drm_or_wddm_test.cpp index 36bd2532ec..ee50643704 100644 --- a/shared/test/unit_test/os_interface/wddm_linux/configure_device_address_space_drm_or_wddm_test.cpp +++ b/shared/test/unit_test/os_interface/wddm_linux/configure_device_address_space_drm_or_wddm_test.cpp @@ -18,7 +18,6 @@ #include "shared/source/os_interface/windows/wddm/um_km_data_translator.h" #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/source/os_interface/windows/wddm_memory_manager.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_gmm.h" @@ -628,9 +627,6 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressS } TEST_F(WddmLinuxTest, givenRequestFor32bitAllocationWithoutPreexistingHostPtrWhenAllocatingThroughKmdIsPreferredThenAllocateThroughKmdAndLockAllocation) { - DebugManagerStateRestore stateRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(static_cast(GfxMemoryAllocationMethod::AllocateByKmd)); - osEnvironment->gdi->reserveGpuVirtualAddress = reserveDeviceAddressSpaceMock; osEnvironment->gdi->createAllocation2 = createAllocation2Mock; osEnvironment->gdi->mapGpuVirtualAddress = mapGpuVirtualAddressMock; diff --git a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 3cdcc084dc..55abdce95e 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -76,7 +76,7 @@ class MockAllocateGraphicsMemoryWithAlignmentWddm : public MemoryManagerCreateallocateGraphicsMemoryWithAlignment(allocData); - if (MockWddmMemoryManager::getPreferredAllocationMethod() == GfxMemoryAllocationMethod::AllocateByKmd) { + if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) { EXPECT_TRUE(memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVACalled); } else { EXPECT_TRUE(memoryManager->allocateSystemMemoryAndCreateGraphicsAllocationFromItCalled); @@ -230,9 +230,6 @@ class WddmMemoryManagerAllocPathTests : public ::testing::Test { }; TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWhenPreferedAllocationMethodThenProperArgumentsAreSet) { - DebugManagerStateRestore stateRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); - { NEO::AllocationData allocData = {}; allocData.type = NEO::AllocationType::SVM_CPU; @@ -240,7 +237,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMa allocData.makeGPUVaDifferentThanCPUPtr = true; auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false); - if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd && !is32bit) { + if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) { EXPECT_FALSE(memoryManager->mapGpuVirtualAddressWithCpuPtr); } else { EXPECT_TRUE(memoryManager->mapGpuVirtualAddressWithCpuPtr); @@ -497,7 +494,7 @@ TEST_F(WddmMemoryManagerTests, givenTypeWhenCallIsStatelessAccessRequiredThenPro TEST_F(WddmMemoryManagerTests, givenForcePreferredAllocationMethodFlagSetWhenGettingPreferredAllocationMethodThenValueFlagIsReturned) { DebugManagerStateRestore restorer; - EXPECT_EQ(preferredAllocationMethod, GfxMemoryAllocationMethod::AllocateByKmd); + EXPECT_EQ(preferredAllocationMethod, MockWddmMemoryManager::getPreferredAllocationMethod()); for (const auto &allocationMethod : {GfxMemoryAllocationMethod::UseUmdSystemPtr, GfxMemoryAllocationMethod::AllocateByKmd}) { DebugManager.flags.ForcePreferredAllocationMethod.set(static_cast(allocationMethod)); @@ -572,7 +569,6 @@ class WddmMemoryManagerSimpleTest : public ::testing::Test { } else { DebugManagerStateRestore dbgRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); wddm->init(); wddm->mapGpuVaStatus = true; VariableBackup restorer{&wddm->callBaseMapGpuVa, false}; @@ -1426,9 +1422,6 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAlignmentRequirementExceedsPageSizeThenA } callCount; }; - DebugManagerStateRestore stateRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); - MockWddmMemoryManagerAllocateWithAlignment memoryManager(true, true, executionEnvironment); AllocationData allocData = {}; @@ -3172,9 +3165,6 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForBufferAndRequest } TEST_F(MockWddmMemoryManagerTest, givenDefaultMemoryManagerWhenItIsCreatedThenCorrectHugeGfxMemoryChunkIsSet) { - DebugManagerStateRestore stateRestore; - DebugManager.flags.ForcePreferredAllocationMethod.set(-1); - MockWddmMemoryManager memoryManager(executionEnvironment); EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::AllocateByKmd), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k); EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::UseUmdSystemPtr), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k); diff --git a/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp b/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp index cfb703c293..e3a03df781 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp @@ -56,7 +56,7 @@ TEST_F(WddmFrontWindowPoolAllocatorTests, givenAllocateInFrontWindowPoolFlagWhen auto gmmHelper = memManager->getGmmHelper(allocData.rootDeviceIndex); EXPECT_EQ(allocation->getGpuBaseAddress(), gmmHelper->canonize(allocation->getGpuAddress())); - if (MockWddmMemoryManager::getPreferredAllocationMethod() == GfxMemoryAllocationMethod::AllocateByKmd) { + if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) { EXPECT_TRUE(allocation->isAllocationLockable()); } else { EXPECT_FALSE(allocation->isAllocationLockable());