File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ class TORCH_API Context {
74
74
static long versionCuDNN () {
75
75
return detail::getCUDAHooks ().versionCuDNN ();
76
76
}
77
+ static bool hasCuSOLVER () {
78
+ return detail::getCUDAHooks ().hasCuSOLVER ();
79
+ }
77
80
static bool hasHIP () {
78
81
return detail::getHIPHooks ().hasHIP ();
79
82
}
Original file line number Diff line number Diff line change @@ -130,6 +130,14 @@ bool CUDAHooks::hasCuDNN() const {
130
130
return AT_CUDNN_ENABLED ();
131
131
}
132
132
133
+ bool CUDAHooks::hasCuSOLVER () const {
134
+ #if defined(CUDART_VERSION) && defined(CUSOLVER_VERSION)
135
+ return true ;
136
+ #else
137
+ return false ;
138
+ #endif
139
+ }
140
+
133
141
#if defined(USE_DIRECT_NVRTC)
134
142
static std::pair<std::unique_ptr<at::DynamicLibrary>, at::cuda::NVRTC*> load_nvrtc () {
135
143
return std::make_pair (nullptr , at::cuda::load_nvrtc ());
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ struct CUDAHooks : public at::CUDAHooksInterface {
26
26
bool hasCUDA () const override ;
27
27
bool hasMAGMA () const override ;
28
28
bool hasCuDNN () const override ;
29
+ bool hasCuSOLVER () const override ;
29
30
const at::cuda::NVRTC& nvrtc () const override ;
30
31
int64_t current_device () const override ;
31
32
bool hasPrimaryContext (int64_t device_index) const override ;
Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ struct TORCH_API CUDAHooksInterface {
102
102
return false ;
103
103
}
104
104
105
+ virtual bool hasCuSOLVER () const {
106
+ return false ;
107
+ }
108
+
105
109
virtual const at::cuda::NVRTC& nvrtc () const {
106
110
TORCH_CHECK (false , " NVRTC requires CUDA. " , CUDA_HELP);
107
111
}
You can’t perform that action at this time.
0 commit comments