[Mlir-commits] [mlir] 1dc0071 - [MLIR] Guard Cuda 12.0+ newer driver APIs with CUDA_VERSION macro checks
Guray Ozen
llvmlistbot at llvm.org
Tue Sep 5 23:17:11 PDT 2023
Author: Guray Ozen
Date: 2023-09-06T08:17:06+02:00
New Revision: 1dc0071216faac0ed05a0442b5977dffbd5c22d1
URL: https://github.com/llvm/llvm-project/commit/1dc0071216faac0ed05a0442b5977dffbd5c22d1
DIFF: https://github.com/llvm/llvm-project/commit/1dc0071216faac0ed05a0442b5977dffbd5c22d1.diff
LOG: [MLIR] Guard Cuda 12.0+ newer driver APIs with CUDA_VERSION macro checks
Fixes #64529
https://github.com/llvm/llvm-project/issues/64529
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D159440
Added:
Modified:
mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
index b4aa90187f572a5..1dba677ebe66365 100644
--- a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
+++ b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
@@ -296,6 +296,12 @@ extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuSetDefaultDevice(int32_t device) {
defaultDevice = device;
}
+///
+/// Runtime methods using CUDA 12.0+ driver
+///
+
+#if (CUDA_VERSION >= 12000)
+
extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuTensorMapEncodeTiled(
CUtensorMap *tensorMap, // Tensor map object
CUtensorMapDataType tensorDataType, // Tensor data type
@@ -378,6 +384,7 @@ extern "C" MLIR_CUDA_WRAPPERS_EXPORT void *mgpuTensorMapEncodeTiledMemref(
sizeof(CUtensorMap)));
return reinterpret_cast<void *>(dTensorMap);
}
+#endif
#ifdef MLIR_ENABLE_CUDA_CUSPARSE
More information about the Mlir-commits
mailing list