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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 28 12:50:32 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/67728.diff


1 Files Affected:

- (modified) mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp (+2) 


``````````diff
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);
 }
 

``````````

</details>


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


More information about the Mlir-commits mailing list