Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dlib/cuda/cudnn_dlibapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,15 @@ namespace dlib
CUDNN_CROSS_CORRELATION)); // could also be CUDNN_CONVOLUTION
#endif

#if CUDNN_MAJOR >= 8
// On Ampere and later GPUs, CUDNN_DEFAULT_MATH permits TF32 Tensor Core
// operations which have reduced precision. Use CUDNN_FMA_MATH to force
// true FP32 computation for consistent numerical results.
CHECK_CUDNN(cudnnSetConvolutionMathType(
(cudnnConvolutionDescriptor_t)conv_handle,
CUDNN_FMA_MATH));
#endif

CHECK_CUDNN(cudnnGetConvolution2dForwardOutputDim(
(const cudnnConvolutionDescriptor_t)conv_handle,
descriptor(data),
Expand Down
Loading