Skip to content

Commit c8cb5e5

Browse files
xwang233facebook-github-bot
authored andcommitted
Relax cusparse windows guard on cuda 11 (#42412)
Summary: Fixes #42406 ### cusparse Xcsrmm2 API: (#37202) - new: https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-function-spmm - old (deprecated in cuda 11): https://docs.nvidia.com/cuda/archive/10.2/cusparse/index.html#csrmm2 Before: |cuda ver | windows | linux | |--|--|--| | 10.1 | old api | old api | | 10.2 | old api | new api | | 11 | old api (build error claimed in #42406) | new api | After: |cuda ver | windows | linux | |--|--|--| | 10.1 | old api | old api | | 10.2 | old api | **old api** | | 11 | **new api** | new api | ### cusparse bmm-sparse-dense API <details><summary>reverted, will be revisited in the future</summary> (cc kurtamohler #33430) - new: https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-function-spmm Before: |cuda ver | windows | linux | |--|--|--| | 10.1 | not supported | new api | | 10.2 | not supported | new api | | 11 | not supported | new api | After: |cuda ver | windows | linux | |--|--|--| | 10.1 | not supported | new api | | 10.2 | not supported | new api | | 11 | **new api** | new api | </details> Pull Request resolved: #42412 Reviewed By: agolynski Differential Revision: D22892032 Pulled By: ezyang fbshipit-source-id: cded614af970f0efdc79c74e18e1d9ea8a46d012
1 parent 24199e0 commit c8cb5e5

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@
99

1010
#include <cusparse.h>
1111

12-
#if !defined(_MSC_VER) && defined(__CUDACC__) && CUSPARSE_VERSION >= 10301 // CUDA release >= 10.2 and not windows
12+
#if defined(__CUDACC__) && CUSPARSE_VERSION >= 11000
1313
#include <library_types.h>
1414
#endif
1515

16-
// LIMITATION (cusparseSpMM):
17-
// The generic APIs are currently (CUDA 10.1) available for all platforms except Windows.
18-
// Using these APIs in any other systems will result in compile-time or run-time failures.
19-
// Their support will be extended in the next releases.
20-
21-
#if !defined(CUSPARSE_VERSION) || (CUSPARSE_VERSION < 10200)
16+
#if !defined(CUSPARSE_VERSION) || (CUSPARSE_VERSION < 10100)
2217
const char* cusparseGetErrorString(cusparseStatus_t status) {
2318
switch(status)
2419
{
@@ -81,7 +76,7 @@ cusparseOperation_t convertTransToCusparseOperation(char trans) {
8176
}
8277
}
8378

84-
#if !defined(_MSC_VER) && defined(__CUDACC__) && CUSPARSE_VERSION >= 10301 // CUDA release >= 10.2 and not windows
79+
#if defined(__CUDACC__) && CUSPARSE_VERSION >= 11000
8580

8681
template<typename T>
8782
void csrmm2(

0 commit comments

Comments
 (0)