mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Avoid implicit sync for async mode immediate copy queue
Related-To: LOCI-1988 Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ced22d45e9
commit
31b2433b2f
@@ -257,6 +257,7 @@ struct CommandList : _ze_command_list_handle_t {
|
||||
uint32_t partitionCount = 1;
|
||||
bool isFlushTaskSubmissionEnabled = false;
|
||||
bool isSyncModeQueue = false;
|
||||
bool isTbxMode = false;
|
||||
bool commandListSLMEnabled = false;
|
||||
bool requiresQueueUncachedMocs = false;
|
||||
|
||||
|
||||
@@ -117,12 +117,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
|
||||
this->partitionCount = static_cast<uint32_t>(this->device->getNEODevice()->getDeviceBitfield().count());
|
||||
}
|
||||
|
||||
if (this->cmdListType == CommandListType::TYPE_IMMEDIATE && !isCopyOnly() && !isInternal()) {
|
||||
const auto &hwInfo = device->getHwInfo();
|
||||
this->isFlushTaskSubmissionEnabled = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily).isPlatformFlushTaskEnabled(hwInfo);
|
||||
if (NEO::DebugManager.flags.EnableFlushTaskSubmission.get() != -1) {
|
||||
this->isFlushTaskSubmissionEnabled = !!NEO::DebugManager.flags.EnableFlushTaskSubmission.get();
|
||||
}
|
||||
if (this->isFlushTaskSubmissionEnabled) {
|
||||
commandContainer.setFlushTaskUsedForImmediate(this->isFlushTaskSubmissionEnabled);
|
||||
}
|
||||
|
||||
@@ -149,17 +144,22 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::executeCommandListImmediate(bo
|
||||
this->close();
|
||||
ze_command_list_handle_t immediateHandle = this->toHandle();
|
||||
|
||||
this->commandContainer.removeDuplicatesFromResidencyContainer();
|
||||
const auto commandListExecutionResult = this->cmdQImmediate->executeCommandLists(1, &immediateHandle, nullptr, performMigration);
|
||||
if (commandListExecutionResult == ZE_RESULT_ERROR_DEVICE_LOST) {
|
||||
return commandListExecutionResult;
|
||||
}
|
||||
|
||||
const auto synchronizationResult = this->cmdQImmediate->synchronize(std::numeric_limits<uint64_t>::max());
|
||||
if (synchronizationResult == ZE_RESULT_ERROR_DEVICE_LOST) {
|
||||
return synchronizationResult;
|
||||
}
|
||||
if (this->isCopyOnly() && !this->isSyncModeQueue && !this->isTbxMode) {
|
||||
this->commandContainer.currentLinearStreamStartOffset = this->commandContainer.getCommandStream()->getUsed();
|
||||
} else {
|
||||
const auto synchronizationResult = this->cmdQImmediate->synchronize(std::numeric_limits<uint64_t>::max());
|
||||
if (synchronizationResult == ZE_RESULT_ERROR_DEVICE_LOST) {
|
||||
return synchronizationResult;
|
||||
}
|
||||
|
||||
this->reset();
|
||||
this->reset();
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,13 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
|
||||
commandList->internalUsage = internalUsage;
|
||||
commandList->cmdListType = CommandListType::TYPE_IMMEDIATE;
|
||||
commandList->isSyncModeQueue = (desc->mode == ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS);
|
||||
if (!(NEO::EngineGroupType::Copy == engineType) && !internalUsage) {
|
||||
const auto &hwInfo = device->getHwInfo();
|
||||
commandList->isFlushTaskSubmissionEnabled = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily).isPlatformFlushTaskEnabled(hwInfo);
|
||||
if (NEO::DebugManager.flags.EnableFlushTaskSubmission.get() != -1) {
|
||||
commandList->isFlushTaskSubmissionEnabled = !!NEO::DebugManager.flags.EnableFlushTaskSubmission.get();
|
||||
}
|
||||
}
|
||||
returnValue = commandList->initialize(device, engineType, desc->flags);
|
||||
if (returnValue != ZE_RESULT_SUCCESS) {
|
||||
commandList->destroy();
|
||||
@@ -130,6 +137,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
|
||||
|
||||
commandList->cmdQImmediate = commandQueue;
|
||||
commandList->csr = csr;
|
||||
commandList->isTbxMode = (csr->getType() == NEO::CommandStreamReceiverType::CSR_TBX) || (csr->getType() == NEO::CommandStreamReceiverType::CSR_TBX_WITH_AUB);
|
||||
commandList->commandListPreemptionMode = device->getDevicePreemptionMode();
|
||||
return commandList;
|
||||
}
|
||||
|
||||
@@ -369,6 +369,7 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
|
||||
auto commandList = CommandList::fromHandle(phCommandLists[i]);
|
||||
auto &cmdBufferAllocations = commandList->commandContainer.getCmdBufferAllocations();
|
||||
auto cmdBufferCount = cmdBufferAllocations.size();
|
||||
bool immediateMode = (commandList->cmdListType == CommandList::CommandListType::TYPE_IMMEDIATE) ? true : false;
|
||||
|
||||
auto commandListPreemption = commandList->getCommandListPreemptionMode();
|
||||
if (statePreemption != commandListPreemption) {
|
||||
@@ -413,7 +414,11 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
|
||||
|
||||
for (size_t iter = 0; iter < cmdBufferCount; iter++) {
|
||||
auto allocation = cmdBufferAllocations[iter];
|
||||
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferStart(&child, allocation->getGpuAddress(), true);
|
||||
uint64_t startOffset = allocation->getGpuAddress();
|
||||
if (immediateMode && (iter == (cmdBufferCount - 1))) {
|
||||
startOffset = ptrOffset(allocation->getGpuAddress(), commandList->commandContainer.currentLinearStreamStartOffset);
|
||||
}
|
||||
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferStart(&child, startOffset, true);
|
||||
}
|
||||
|
||||
printfFunctionContainer.insert(printfFunctionContainer.end(),
|
||||
|
||||
Reference in New Issue
Block a user