mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
refactor: pass extra param to isDefaultCmdListWithCopyOffloadSupported
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d247358fdf
commit
542f47dfe6
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user