Revert "[L0][XE_HPC]Perform memcpy on CPU by default"

This reverts commit 383f33b482.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-10-05 07:25:38 +02:00
committed by Compute-Runtime-Automation
parent 06817090bf
commit cfd96980a0
12 changed files with 21 additions and 47 deletions

View File

@@ -329,6 +329,9 @@ struct CommandList : _ze_command_list_handle_t {
bool systolicModeSupport = false;
bool pipelineSelectStateTracking = false;
bool stateComputeModeTracking = false;
std::atomic<uint32_t> barrierCounter{0u};
uint32_t latestFlushedBarrierCounter = 0u;
};
using CommandListAllocatorFn = CommandList *(*)(uint32_t);

View File

@@ -2517,6 +2517,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBarrier(ze_event_handle_
}
appendSignalEventPostWalker(signalEvent, workloadPartition);
this->barrierCounter++;
return ZE_RESULT_SUCCESS;
}

View File

@@ -132,9 +132,6 @@ struct CommandListCoreFamilyImmediate : public CommandListCoreFamily<gfxCoreFami
bool isAllocUSMDeviceMemory(NEO::SvmAllocationData *alloc, bool allocFound);
ze_result_t performCpuMemcpy(void *dstptr, const void *srcptr, size_t size, bool isDstDeviceMemory, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents);
void *obtainLockedPtrFromDevice(void *ptr, size_t size);
protected:
std::atomic<bool> barrierCalled{false};
};
template <PRODUCT_FAMILY gfxProductFamily>

View File

@@ -246,8 +246,6 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendBarrier(
checkAvailableSpace();
}
ret = CommandListCoreFamily<gfxCoreFamily>::appendBarrier(hSignalEvent, numWaitEvents, phWaitEvents);
this->barrierCalled = true;
return flushImmediate(ret, true, hSignalEvent);
}
@@ -546,7 +544,8 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::performCpuMemcpy(void
this->appendBarrier(nullptr, numWaitEvents, phWaitEvents);
}
if (this->barrierCalled) {
bool needsFlushTagUpdate = this->latestFlushedBarrierCounter < this->barrierCounter;
if (needsFlushTagUpdate) {
this->csr->flushTagUpdate();
}
@@ -565,13 +564,13 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::performCpuMemcpy(void
cpuMemcpyDstPtr = dstptr;
}
if (this->barrierCalled) {
if (needsFlushTagUpdate) {
auto timeoutMicroseconds = NEO::TimeoutControls::maxTimeout;
const auto waitStatus = this->csr->waitForCompletionWithTimeout(NEO::WaitParams{false, false, timeoutMicroseconds}, this->csr->peekTaskCount());
if (waitStatus == NEO::WaitStatus::GpuHang) {
return ZE_RESULT_ERROR_DEVICE_LOST;
}
this->barrierCalled = false;
this->latestFlushedBarrierCounter = this->barrierCounter;
}
if (signalEvent) {

View File

@@ -484,7 +484,6 @@ class MockCommandListImmediateHw : public WhiteBox<::L0::CommandListCoreFamilyIm
using BaseClass = WhiteBox<::L0::CommandListCoreFamilyImmediate<gfxCoreFamily>>;
MockCommandListImmediateHw() : BaseClass() {}
using BaseClass::applyMemoryRangesBarrier;
using BaseClass::barrierCalled;
using BaseClass::isFlushTaskSubmissionEnabled;
using BaseClass::isSyncModeQueue;

View File

@@ -886,6 +886,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore,
struct AppendMemoryLockedCopyFixture : public DeviceFixture {
void setUp() {
DebugManager.flags.ExperimentalCopyThroughLock.set(1);
DeviceFixture::setUp();
nonUsmHostPtr = new char[sz];
@@ -1075,23 +1076,6 @@ HWTEST2_F(AppendMemoryLockedCopyTest, givenImmediateCommandListWhenCpuMemcpyWith
EXPECT_EQ(waitForFlushTagUpdateCalled, 1u);
}
HWTEST2_F(AppendMemoryLockedCopyTest, givenImmediateCommandListWhenAppendBarrierThenSetBarrierCalled, IsXeHpcCore) {
MockCommandListImmediateHw<gfxCoreFamily> cmdList;
cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u);
cmdList.csr = device->getNEODevice()->getInternalEngine().commandStreamReceiver;
EXPECT_FALSE(cmdList.barrierCalled);
cmdList.appendBarrier(nullptr, 0, nullptr);
EXPECT_TRUE(cmdList.barrierCalled);
auto res = cmdList.appendMemoryCopy(devicePtr, nonUsmHostPtr, 1024, nullptr, 0, nullptr);
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
EXPECT_FALSE(cmdList.barrierCalled);
}
template <GFXCORE_FAMILY gfxCoreFamily>
class MockAppendMemoryLockedCopyTestImmediateCmdList : public MockCommandListImmediateHw<gfxCoreFamily> {
public: