Skip to content

Commit 1dc0071

Browse files
committed
[MLIR] Guard Cuda 12.0+ newer driver APIs with CUDA_VERSION macro checks
Fixes llvm#64529 llvm#64529 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D159440
1 parent 71be020 commit 1dc0071

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuSetDefaultDevice(int32_t device) {
296296
defaultDevice = device;
297297
}
298298

299+
///
300+
/// Runtime methods using CUDA 12.0+ driver
301+
///
302+
303+
#if (CUDA_VERSION >= 12000)
304+
299305
extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuTensorMapEncodeTiled(
300306
CUtensorMap *tensorMap, // Tensor map object
301307
CUtensorMapDataType tensorDataType, // Tensor data type
@@ -378,6 +384,7 @@ extern "C" MLIR_CUDA_WRAPPERS_EXPORT void *mgpuTensorMapEncodeTiledMemref(
378384
sizeof(CUtensorMap)));
379385
return reinterpret_cast<void *>(dTensorMap);
380386
}
387+
#endif
381388

382389
#ifdef MLIR_ENABLE_CUDA_CUSPARSE
383390

0 commit comments

Comments
 (0)