Fix cusparse version check (#32405)
Summary:
The current version check doesn't use proper lexicographic comparison and so will break for future versions of cuSPARSE with `CUSPARSE_VER_MAJOR > 10` and `CUSPARSE_VER_MINOR < 2`. Also, my cusparse headers for CUDA 9 don't seem to include version macros at all, so added `if !defined` to be explicit about that.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32405
Differential Revision: D19499412
Pulled By: ezyang
fbshipit-source-id: 1593bf1e5a4aae8b75bb3b350d016cc6c3b9c009