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 2c1f31a96e..eb15ff4117 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -339,7 +339,8 @@ HWTEST_F(EnqueueMapBufferTest, givenNonBlockingReadOnlyMapBufferOnZeroCopyBuffer auto callbackCalled = 0u; - *pTagMemory += 4; + auto newTag = *pTagMemory + 4; + *pTagMemory = newTag; clSetEventCallback(mapEventReturned, CL_COMPLETE, E2Clb::signalEv2, (void *)&callbackCalled); 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 4749e94208..8ef5cc0ce1 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -380,7 +380,8 @@ HWTEST_F(EnqueueMapImageTest, givenNonReadOnlyMapWithOutEventWhenMappedThenSetEv taskCount = commandStreamReceiver.peekTaskCount(); EXPECT_EQ(3u, taskCount); - (*pTagMemory)++; + auto newTag = *pTagMemory + 1; + (*pTagMemory) = newTag; retVal = clEnqueueUnmapMemObject( pCmdQ, image, diff --git a/shared/source/os_interface/windows/windows_defs.h b/shared/source/os_interface/windows/windows_defs.h index 0277a0efe3..9b33bf4645 100644 --- a/shared/source/os_interface/windows/windows_defs.h +++ b/shared/source/os_interface/windows/windows_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ struct MonitoredFence { D3DKMT_HANDLE fenceHandle = 0; D3DGPU_VIRTUAL_ADDRESS gpuAddress = 0; volatile uint64_t *cpuAddress = nullptr; - volatile uint64_t currentFenceValue = 0; + uint64_t currentFenceValue = 0; uint64_t lastSubmittedFence = 0; }; diff --git a/shared/test/common/mocks/mock_migration_sync_data.h b/shared/test/common/mocks/mock_migration_sync_data.h index 6dc2a3e1f3..4a344b1bbe 100644 --- a/shared/test/common/mocks/mock_migration_sync_data.h +++ b/shared/test/common/mocks/mock_migration_sync_data.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,7 +13,8 @@ namespace NEO { struct MockMigrationSyncDataWithYield : public MigrationSyncData { using MigrationSyncData::MigrationSyncData; void yield() const override { - (*this->tagAddress)++; + auto newTag = *this->tagAddress + 1; + *this->tagAddress = newTag; MigrationSyncData::yield(); } }; diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 504cd51895..7b69b6d859 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -455,7 +455,7 @@ HWTEST_F(CommandStreamReceiverTest, givenGpuHangWhenWaititingForCompletionWithTi csr.activePartitions = 1; csr.gpuHangCheckPeriod = 0us; - volatile TagAddressType tasksCount[16] = {}; + TagAddressType tasksCount[16] = {}; csr.tagAddress = tasksCount; constexpr auto enableTimeout = false; @@ -470,7 +470,7 @@ HWTEST_F(CommandStreamReceiverTest, givenNoGpuHangWhenWaititingForCompletionWith auto driverModelMock = std::make_unique(); driverModelMock->isGpuHangDetectedToReturn = false; - volatile TagAddressType tasksCount[16] = {}; + TagAddressType tasksCount[16] = {}; driverModelMock->isGpuHangDetectedSideEffect = [&tasksCount] { tasksCount[0]++; }; diff --git a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp index 289dd4a02f..5d522de250 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -2351,7 +2351,8 @@ HWTEST_F(GraphicsAllocationDestroyTests, givenAllocationUsedOnlyByNonDefaultCsrW memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(graphicsAllocation); EXPECT_NE(nullptr, nonDefaultCsr->getInternalAllocationStorage()->getDeferredAllocations().peekHead()); - (*nonDefaultCsr->getTagAddress())++; + auto newTag = *nonDefaultCsr->getTagAddress() + 1; + (*nonDefaultCsr->getTagAddress()) = newTag; // no need to call freeGraphicsAllocation } @@ -2374,7 +2375,8 @@ HWTEST_F(GraphicsAllocationDestroyTests, givenAllocationUsedOnlyByNonDefaultDevi memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(graphicsAllocation); EXPECT_FALSE(nonDefaultCommandStreamReceiver.getInternalAllocationStorage()->getDeferredAllocations().peekIsEmpty()); EXPECT_TRUE(nonDefaultCommandStreamReceiver.getInternalAllocationStorage()->getTemporaryAllocations().peekIsEmpty()); - (*nonDefaultCommandStreamReceiver.getTagAddress())++; + auto newTag = *nonDefaultCommandStreamReceiver.getTagAddress() + 1; + (*nonDefaultCommandStreamReceiver.getTagAddress()) = newTag; // no need to call freeGraphicsAllocation }