Skip to content

Commit

Permalink
Fix IS_SPMM_AVAILABLE macro definition (pytorch#42643)
Browse files Browse the repository at this point in the history
Summary:
This should fix CUDA-11 on Windows build issue

`defined` is not a function, and so it can not be used in macro substitution.

Pull Request resolved: pytorch#42643

Reviewed By: pbelevich, xw285cornell

Differential Revision: D22963420

Pulled By: malfet

fbshipit-source-id: cccf7db0d03cd62b655beeb154db9e628aa749f0
  • Loading branch information
malfet authored and facebook-github-bot committed Aug 6, 2020
1 parent 509fb77 commit 9add11f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
// Using these APIs in any other systems will result in compile-time or run-time failures.
// Their support will be extended in the next releases.

#define IS_SPMM_AVAILABLE() (defined(__CUDACC__) && \
(CUSPARSE_VERSION >= 11000 || \
(!defined(_MSC_VER) && CUSPARSE_VERSION >= 10301)))
#if defined(__CUDACC__) && (CUSPARSE_VERSION >= 11000 || (!defined(_MSC_VER) && CUSPARSE_VERSION >= 10301))
#define IS_SPMM_AVAILABLE() 1
#else
#define IS_SPMM_AVAILABLE() 0
#endif

#if IS_SPMM_AVAILABLE()
#include <library_types.h>
Expand Down

0 comments on commit 9add11f

Please sign in to comment.