Skip to content

Commit 807434f

Browse files
committed
Add support for flags with CUDA 11.4-11.8 (untested)
1 parent 7ca370d commit 807434f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/adapters/cuda/command_buffer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,15 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
140140
UR_APIEXPORT ur_result_t UR_APICALL
141141
urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
142142
try {
143+
const unsigned long long flags = 0;
143144
#if CUDA_VERSION >= 12000
144145
UR_CHECK_ERROR(cuGraphInstantiate(&hCommandBuffer->CudaGraphExec,
145-
hCommandBuffer->CudaGraph, 0));
146+
hCommandBuffer->CudaGraph, flags));
147+
#elif CUDA_VERSION >= 11040
148+
UR_CHECK_ERROR(cuGraphInstantiateWithFlags(
149+
&hCommandBuffer->CudaGraphExec, hCommandBuffer->CudaGraph, flags));
146150
#else
151+
// Cannot use flags
147152
UR_CHECK_ERROR(cuGraphInstantiate(&hCommandBuffer->CudaGraphExec,
148153
hCommandBuffer->CudaGraph, nullptr,
149154
nullptr, 0));

0 commit comments

Comments
 (0)