Skip to content

Commit 3fd39f3

Browse files
committed
[UR][CUDA] Fix compatibility with CUDA 11.x
The code introduced in 74f42f8 uses the signature of cuGraphInstantiate from CUDA 12.x. In CUDA 11.x, this function has different parameters.
1 parent ba994bb commit 3fd39f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/adapters/cuda/command_buffer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,13 @@ 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+
#if CUDART_VERSION >= 12000
143144
UR_CHECK_ERROR(cuGraphInstantiate(&hCommandBuffer->CudaGraphExec,
144145
hCommandBuffer->CudaGraph, 0));
146+
#else
147+
UR_CHECK_ERROR(cuGraphInstantiate(&hCommandBuffer->CudaGraphExec,
148+
hCommandBuffer->CudaGraph, nullptr, nullptr, 0));
149+
#endif
145150
} catch (...) {
146151
return UR_RESULT_ERROR_UNKNOWN;
147152
}

0 commit comments

Comments
 (0)