Update cusparse deprecated Xcsrmm2 call (#36845)
Summary:
The new function signature https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-function-spmm.
Please also check https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-api-reference for the limitations. I have added windows guard in this PR.
> LIMITATION: The generic APIs are currently available for all platforms except Windows. 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.
Edit: also add a cuda guard to let ROCm use old version API (avoid build failures)
Since the new cusparse signatures sometimes give inaccurate results in CUDA 10.1, and this was fixed in CUDA 10.2, the new signatures should only be used with CUDA >= 10.2
cc csarofeen ptrblck
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36845
Differential Revision: D21196366
Pulled By: ezyang
fbshipit-source-id: 592d6bd6379f7db52cbad827d43864ea65ff18ea