refactor: pass extra param to isDefaultCmdListWithCopyOffloadSupported

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2025-05-23 15:46:42 +00:00
committed by Compute-Runtime-Automation
parent d247358fdf
commit 542f47dfe6
5 changed files with 8 additions and 12 deletions

View File

@@ -336,7 +336,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
enableSynchronizedDispatch((NEO::debugManager.flags.ForceSynchronizedDispatchMode.get() == 1) ? NEO::SynchronizedDispatchMode::full : NEO::SynchronizedDispatchMode::disabled);
}
const bool copyOffloadSupported = l0GfxCoreHelper.isDefaultCmdListWithCopyOffloadSupported() || (NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.get() == 2);
const bool copyOffloadSupported = l0GfxCoreHelper.isDefaultCmdListWithCopyOffloadSupported(this->useAdditionalBlitProperties);
if (copyOffloadSupported && !this->internalUsage && !isCopyOffloadEnabled()) {
enableCopyOperationOffload();

View File

@@ -269,7 +269,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
}
void CommandListImp::enableCopyOperationOffload() {
if (isCopyOnly(false)) {
if (isCopyOnly(false) || !static_cast<DeviceImp *>(device)->tryGetCopyEngineOrdinal().has_value()) {
return;
}
@@ -280,11 +280,6 @@ void CommandListImp::enableCopyOperationOffload() {
return;
}
if (!static_cast<DeviceImp *>(device)->tryGetCopyEngineOrdinal().has_value()) {
this->copyOffloadMode = CopyOffloadModes::disabled;
return;
}
auto &computeOsContext = getCsr(false)->getOsContext();
ze_command_queue_priority_t immediateQueuePriority = ZE_COMMAND_QUEUE_PRIORITY_NORMAL;

View File

@@ -115,7 +115,7 @@ class L0GfxCoreHelper : public NEO::ApiGfxCoreHelper {
NEO::DeviceBitfield deviceBitfield) const = 0;
virtual uint64_t getOaTimestampValidBits() const = 0;
virtual CopyOffloadMode getDefaultCopyOffloadMode(bool additionalBlitPropertiesSupported) const = 0;
virtual bool isDefaultCmdListWithCopyOffloadSupported() const = 0;
virtual bool isDefaultCmdListWithCopyOffloadSupported(bool additionalBlitPropertiesSupported) const = 0;
protected:
L0GfxCoreHelper() = default;
@@ -173,7 +173,7 @@ class L0GfxCoreHelperHw : public L0GfxCoreHelper {
NEO::DeviceBitfield deviceBitfield) const override;
uint64_t getOaTimestampValidBits() const override;
CopyOffloadMode getDefaultCopyOffloadMode(bool additionalBlitPropertiesSupported) const override;
bool isDefaultCmdListWithCopyOffloadSupported() const override;
bool isDefaultCmdListWithCopyOffloadSupported(bool additionalBlitPropertiesSupported) const override;
protected:
L0GfxCoreHelperHw() = default;

View File

@@ -105,8 +105,8 @@ CopyOffloadMode L0GfxCoreHelperHw<Family>::getDefaultCopyOffloadMode(bool additi
}
template <typename Family>
bool L0GfxCoreHelperHw<Family>::isDefaultCmdListWithCopyOffloadSupported() const {
return false;
bool L0GfxCoreHelperHw<Family>::isDefaultCmdListWithCopyOffloadSupported(bool additionalBlitPropertiesSupported) const {
return (NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.get() == 2);
}
} // namespace L0

View File

@@ -385,8 +385,9 @@ HWTEST_F(CopyOffloadInOrderTests, givenNonDualStreamOffloadWhenCreatingCmdListTh
cmdListDesc.flags = 0;
ASSERT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreate(context->toHandle(), device->toHandle(), &cmdListDesc, &hCmdList));
bool supported = device->getL0GfxCoreHelper().isDefaultCmdListWithCopyOffloadSupported(device->getProductHelper().useAdditionalBlitProperties());
EXPECT_EQ(CopyOffloadModes::disabled, static_cast<CommandListImp *>(CommandList::fromHandle(hCmdList))->getCopyOffloadModeForOperation(true));
EXPECT_EQ(!supported, CopyOffloadModes::disabled == static_cast<CommandListImp *>(CommandList::fromHandle(hCmdList))->getCopyOffloadModeForOperation(true));
zeCommandListDestroy(hCmdList);
}