Skip to content

Commit e7187aa

Browse files
committed
[SYCL][Graph] Only get command handle for updatable command-buffers
- Update UR tag to include changes to command-handles - Update calls to UrCommandBufferAppendKernelLaunch to only request command handles for updatable command-buffers - Only store command handles for updatable command-graphs - Update UR commit tag
1 parent 6825615 commit e7187aa

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ if(SYCL_UR_USE_FETCH_CONTENT)
116116
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
117117
endfunction()
118118

119-
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
120-
# commit b79ebe4e98789144bcdf3832088eb6e6b5ae6967
121-
# Merge: 7b4bc761 fbb6e862
122-
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
123-
# Date: Fri Oct 4 16:39:59 2024 +0100
124-
# Merge pull request #2018 from wenju-he/L0-bindless-image-device-query
125-
# [L0] Fix device query of bindless image support
126-
set(UNIFIED_RUNTIME_TAG b79ebe4e98789144bcdf3832088eb6e6b5ae6967)
119+
set(UNIFIED_RUNTIME_REPO "https://github.com/bensuo/unified-runtime.git")
120+
# commit 22962057df1b9d538e08088a7b75d9d8e7c29f90 (HEAD, origin/main, origin/HEAD)
121+
# Merge: e824ddc2 f0a1c433
122+
# Author: aarongreig <aaron.greig@codeplay.com>
123+
# Date: Fri Sep 27 16:54:04 2024 +0100
124+
# Merge pull request #2017 from nrspruit/new_sysman_init
125+
# [L0] Use zesInit for SysMan API usage
126+
set(UNIFIED_RUNTIME_TAG 508a4531367f57c9d0deb38f151423530a350e54)
127127

128128
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
129129
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need

sycl/source/detail/graph_impl.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,11 @@ exec_graph_impl::enqueueNodeDirect(sycl::context Ctx,
703703
ur_result_t Res = sycl::detail::enqueueImpCommandBufferKernel(
704704
Ctx, DeviceImpl, CommandBuffer,
705705
*static_cast<sycl::detail::CGExecKernel *>((Node->MCommandGroup.get())),
706-
Deps, &NewSyncPoint, &NewCommand, nullptr);
706+
Deps, &NewSyncPoint, MIsUpdatable ? &NewCommand : nullptr, nullptr);
707707

708-
MCommandMap[Node] = NewCommand;
708+
if (MIsUpdatable) {
709+
MCommandMap[Node] = NewCommand;
710+
}
709711

710712
if (Res != UR_RESULT_SUCCESS) {
711713
throw sycl::exception(errc::invalid,
@@ -741,7 +743,10 @@ ur_exp_command_buffer_sync_point_t exec_graph_impl::enqueueNode(
741743
Node->getCGCopy(), AllocaQueue, /*EventNeeded=*/true, CommandBuffer,
742744
Deps);
743745

744-
MCommandMap[Node] = Event->getCommandBufferCommand();
746+
if (MIsUpdatable) {
747+
MCommandMap[Node] = Event->getCommandBufferCommand();
748+
}
749+
745750
return Event->getSyncPoint();
746751
}
747752
void exec_graph_impl::createCommandBuffers(

sycl/source/detail/scheduler/commands.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2558,12 +2558,21 @@ ur_result_t enqueueImpCommandBufferKernel(
25582558
LocalSize = RequiredWGSize;
25592559
}
25602560

2561+
// Command-buffers which are not updatable cannot return command handles, so
2562+
// we query the descriptor here to check if a handle is required.
2563+
ur_exp_command_buffer_desc_t CommandBufferDesc{};
2564+
2565+
Adapter->call<UrApiKind::urCommandBufferGetInfoExp>(
2566+
CommandBuffer,
2567+
ur_exp_command_buffer_info_t::UR_EXP_COMMAND_BUFFER_INFO_DESCRIPTOR,
2568+
sizeof(ur_exp_command_buffer_desc_t), &CommandBufferDesc, nullptr);
2569+
25612570
ur_result_t Res =
25622571
Adapter->call_nocheck<UrApiKind::urCommandBufferAppendKernelLaunchExp>(
25632572
CommandBuffer, UrKernel, NDRDesc.Dims, &NDRDesc.GlobalOffset[0],
25642573
&NDRDesc.GlobalSize[0], LocalSize, 0, nullptr, SyncPoints.size(),
25652574
SyncPoints.size() ? SyncPoints.data() : nullptr, OutSyncPoint,
2566-
OutCommand);
2575+
CommandBufferDesc.isUpdatable ? OutCommand : nullptr);
25672576

25682577
if (!SyclKernelImpl && !Kernel) {
25692578
Adapter->call<UrApiKind::urKernelRelease>(UrKernel);

0 commit comments

Comments
 (0)