Revert "performance: Use lock pointer copy with sfence for dc flush mitigation"

This reverts commit 8c3c703ec0.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2024-10-26 14:04:44 +02:00
committed by Compute-Runtime-Automation
parent ebdded1bb9
commit f5c433c8f8
5 changed files with 20 additions and 26 deletions

View File

@@ -20,7 +20,7 @@ bool CommandQueue::isTimestampWaitEnabled() {
}
bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type) {
return ultHwConfig.useGpuCopyForDcFlushMitigation;
return false;
}
} // namespace NEO

View File

@@ -599,22 +599,26 @@ TEST(Buffer, givenClMemCopyHostPointerPassedToBufferCreateWhenAllocationIsNotInS
}
}
namespace CpuIntrinsicsTests {
extern std::atomic<uint32_t> sfenceCounter;
} // namespace CpuIntrinsicsTests
TEST(Buffer, givenDcFlushMitigationWhenCreateBufferCopyHostptrThenUseLockPointerCopyWithSfence) {
TEST(Buffer, givenDcFlushMitigationWhenCreateBufferCopyHostptrThenUseBlitterCopy) {
DebugManagerStateRestore restorer;
debugManager.flags.AllowDcFlush.set(0);
ExecutionEnvironment *executionEnvironment = MockClDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
auto productHelper = executionEnvironment->rootDeviceEnvironments[0]->productHelper.get();
if (!productHelper->isDcFlushMitigated()) {
if (!(productHelper->isBlitterFullySupported(*defaultHwInfo) && productHelper->isDcFlushMitigated())) {
GTEST_SKIP();
}
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useGpuCopyForDcFlushMitigation = true;
DebugManagerStateRestore restorer;
debugManager.flags.AllowDcFlush.set(0);
auto blitterCalled = 0u;
auto mockBlitMemoryToAllocation = [&](const NEO::Device &device, NEO::GraphicsAllocation *memory, size_t offset, const void *hostPtr,
Vec3<size_t> size) -> NEO::BlitOperationResult {
memcpy(memory->getUnderlyingBuffer(), hostPtr, size.x);
blitterCalled++;
return BlitOperationResult::success;
};
VariableBackup<NEO::BlitHelperFunctions::BlitMemoryToAllocationFunc> blitMemoryToAllocationFuncBackup(
&NEO::BlitHelperFunctions::blitMemoryToAllocation, mockBlitMemoryToAllocation);
auto *memoryManager = new MockMemoryManagerFailFirstAllocation(*executionEnvironment);
executionEnvironment->memoryManager.reset(memoryManager);
@@ -622,7 +626,6 @@ TEST(Buffer, givenDcFlushMitigationWhenCreateBufferCopyHostptrThenUseLockPointer
auto device = std::make_unique<MockClDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0));
MockContext ctx(device.get());
CpuIntrinsicsTests::sfenceCounter.store(0u);
cl_int retVal = 0;
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR;
@@ -631,8 +634,7 @@ TEST(Buffer, givenDcFlushMitigationWhenCreateBufferCopyHostptrThenUseLockPointer
std::unique_ptr<Buffer> buffer(Buffer::create(&ctx, flags, sizeof(memory), memory, retVal));
ASSERT_NE(nullptr, buffer.get());
EXPECT_EQ(1u, CpuIntrinsicsTests::sfenceCounter.load());
CpuIntrinsicsTests::sfenceCounter.store(0u);
EXPECT_EQ(blitterCalled, 1u);
}
TEST(Buffer, givenPropertiesWithClDeviceHandleListKHRWhenCreateBufferThenCorrectBufferIsSet) {