[Mlir-commits] [mlir] [mlir][sparse][gpu] project BSR method with cuda 12.1 (PR #67728)

Aart Bik llvmlistbot at llvm.org
Thu Sep 28 12:49:31 PDT 2023


https://github.com/aartbik created https://github.com/llvm/llvm-project/pull/67728

MLIR official build is not quiet at 12.1 yet, so until then we protext the Bsr method with a macro guard

>From a08c5546785cce9d849c44e04f5ebd6cff1d9903 Mon Sep 17 00:00:00 2001
From: Aart Bik <ajcbik at google.com>
Date: Thu, 28 Sep 2023 12:47:48 -0700
Subject: [PATCH] [mlir][sparse][gpu] project BSR method with cuda 12.1

MLIR official build is not quiet at 12.1 yet, so until
then we protext the Bsr method with a macro guard
---
 mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
index 8561aa090d32fd9..55db744af021c14 100644
--- a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
+++ b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
@@ -545,12 +545,14 @@ mgpuCreateBsr(intptr_t brows, intptr_t bcols, intptr_t bnnz, intptr_t rBsz,
               intptr_t cBsz, void *rowPos, void *colIdxs, void *values,
               int32_t ptp, int32_t itp, int32_t dtp, CUstream /*stream*/) {
   cusparseSpMatDescr_t mat = nullptr;
+#if CUSPARSE_VERSION >= 12100
   auto pTp = static_cast<cusparseIndexType_t>(ptp);
   auto iTp = static_cast<cusparseIndexType_t>(itp);
   auto dTp = static_cast<cudaDataType_t>(dtp);
   CUSPARSE_REPORT_IF_ERROR(cusparseCreateBsr(
       &mat, brows, bcols, bnnz, rBsz, cBsz, rowPos, colIdxs, values, pTp, iTp,
       CUSPARSE_INDEX_BASE_ZERO, dTp, CUSPARSE_ORDER_ROW))
+#endif
   return reinterpret_cast<void *>(mat);
 }
 



More information about the Mlir-commits mailing list