mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
feature: enable copy offload api
Related-To: NEO-11376 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
037957a7ae
commit
2e9bb26708
@@ -251,7 +251,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
|
|||||||
commandList->enableSynchronizedDispatch(queueProperties.synchronizedDispatchMode);
|
commandList->enableSynchronizedDispatch(queueProperties.synchronizedDispatchMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.get() == 1) && !commandList->isCopyOnly() && commandList->isInOrderExecutionEnabled()) {
|
if ((NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.get() == 1 || queueProperties.copyOffloadHint) && !commandList->isCopyOnly() && commandList->isInOrderExecutionEnabled()) {
|
||||||
commandList->enableCopyOperationOffload(productFamily, device, desc);
|
commandList->enableCopyOperationOffload(productFamily, device, desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -374,6 +374,8 @@ QueueProperties CommandQueue::extractQueueProperties(const ze_command_queue_desc
|
|||||||
if (syncDispatchMode.has_value()) {
|
if (syncDispatchMode.has_value()) {
|
||||||
queueProperties.synchronizedDispatchMode = syncDispatchMode.value();
|
queueProperties.synchronizedDispatchMode = syncDispatchMode.value();
|
||||||
}
|
}
|
||||||
|
} else if (baseProperties->stype == ZEX_INTEL_STRUCTURE_TYPE_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_PROPERTIES) {
|
||||||
|
queueProperties.copyOffloadHint = static_cast<const zex_intel_queue_copy_operations_offload_hint_exp_desc_t *>(desc.pNext)->copyOffloadEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
baseProperties = static_cast<const ze_base_desc_t *>(baseProperties->pNext);
|
baseProperties = static_cast<const ze_base_desc_t *>(baseProperties->pNext);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ struct Device;
|
|||||||
struct QueueProperties {
|
struct QueueProperties {
|
||||||
NEO::SynchronizedDispatchMode synchronizedDispatchMode = NEO::SynchronizedDispatchMode::disabled;
|
NEO::SynchronizedDispatchMode synchronizedDispatchMode = NEO::SynchronizedDispatchMode::disabled;
|
||||||
bool interruptHint = false;
|
bool interruptHint = false;
|
||||||
|
bool copyOffloadHint = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CommandQueue : _ze_command_queue_handle_t {
|
struct CommandQueue : _ze_command_queue_handle_t {
|
||||||
|
|||||||
@@ -6922,6 +6922,42 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HWTEST2_F(CopyOffloadInOrderTests, givenQueueDescriptorWhenCreatingCmdListThenEnableCopyOffload, IsAtLeastXeHpCore) {
|
||||||
|
NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.set(-1);
|
||||||
|
|
||||||
|
ze_command_list_handle_t cmdListHandle;
|
||||||
|
|
||||||
|
zex_intel_queue_copy_operations_offload_hint_exp_desc_t copyOffloadDesc = {ZEX_INTEL_STRUCTURE_TYPE_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_PROPERTIES};
|
||||||
|
copyOffloadDesc.copyOffloadEnabled = true;
|
||||||
|
|
||||||
|
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||||
|
cmdQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_NORMAL;
|
||||||
|
cmdQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_IN_ORDER;
|
||||||
|
cmdQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
|
||||||
|
|
||||||
|
cmdQueueDesc.pNext = ©OffloadDesc;
|
||||||
|
|
||||||
|
{
|
||||||
|
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle));
|
||||||
|
auto cmdList = static_cast<WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>> *>(CommandList::fromHandle(cmdListHandle));
|
||||||
|
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
|
||||||
|
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
|
||||||
|
|
||||||
|
zeCommandListDestroy(cmdListHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
copyOffloadDesc.copyOffloadEnabled = false;
|
||||||
|
|
||||||
|
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle));
|
||||||
|
auto cmdList = static_cast<WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>> *>(CommandList::fromHandle(cmdListHandle));
|
||||||
|
EXPECT_FALSE(cmdList->copyOperationOffloadEnabled);
|
||||||
|
EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload);
|
||||||
|
|
||||||
|
zeCommandListDestroy(cmdListHandle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HWTEST2_F(CopyOffloadInOrderTests, givenCopyOffloadEnabledWhenProgrammingHwCmdsThenUserCopyCommands, IsAtLeastXeHpCore) {
|
HWTEST2_F(CopyOffloadInOrderTests, givenCopyOffloadEnabledWhenProgrammingHwCmdsThenUserCopyCommands, IsAtLeastXeHpCore) {
|
||||||
using XY_COPY_BLT = typename std::remove_const<decltype(FamilyType::cmdInitXyCopyBlt)>::type;
|
using XY_COPY_BLT = typename std::remove_const<decltype(FamilyType::cmdInitXyCopyBlt)>::type;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user