File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
torch/csrc/autograd/functions Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,9 @@ auto ConvForward::apply(const variable_list& inputs) -> variable_list {
125125
126126 bool use_cudnn = false ;
127127#ifdef WITH_CUDNN
128- use_cudnn = (input->isCuda () && (!is_dilated () || CUDNN_VERSION >= 6000 )) && cudnn_enabled;
128+ cudaDeviceProp* prop =
129+ THCState_getCurrentDeviceProperties (state);
130+ use_cudnn = (input->isCuda () && (!is_dilated () || CUDNN_VERSION >= 6000 ) && (!is_dilated () || prop->major >= 5 ) ) && cudnn_enabled;
129131#endif
130132
131133 std::unique_ptr<Tensor> output;
@@ -212,7 +214,9 @@ auto ConvBackward::apply(const variable_list& grad_outputs) -> variable_list {
212214
213215 bool use_cudnn = false ;
214216#ifdef WITH_CUDNN
215- use_cudnn = (input->isCuda () && (!is_dilated () || CUDNN_VERSION >= 6000 )) && cudnn_enabled;
217+ cudaDeviceProp* prop =
218+ THCState_getCurrentDeviceProperties (state);
219+ use_cudnn = (input->isCuda () && (!is_dilated () || CUDNN_VERSION >= 6000 ) && (!is_dilated () || prop->major >= 5 ) ) && cudnn_enabled;
216220#endif
217221
218222 std::unique_ptr<Tensor> grad_input;
You can’t perform that action at this time.
0 commit comments