Skip to content

Commit

Permalink
Print CuDNN version correctly. (pytorch#19110)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#19110
ghimport-source-id: efbaf9b

Differential Revision: D14874497

Pulled By: ezyang

fbshipit-source-id: ced03576f7598189dd8cce79b3303a5529551f46
  • Loading branch information
ezyang authored and facebook-github-bot committed Apr 10, 2019
1 parent 8e8874a commit 7031394
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions aten/src/ATen/cuda/detail/CUDAHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,18 @@ std::string CUDAHooks::showConfig() const {

#ifndef __HIP_PLATFORM_HCC__
#if AT_CUDNN_ENABLED()


auto printCudnnStyleVersion = [&](int v) {
oss << (v / 1000) << "." << (v / 100 % 10);
if (v % 100 != 0) {
oss << "." << (v % 100);
}
};

size_t cudnnVersion = cudnnGetVersion();
oss << " - CudNN ";
printCudaStyleVersion(cudnnVersion);
oss << " - CuDNN ";
printCudnnStyleVersion(cudnnVersion);
size_t cudnnCudartVersion = cudnnGetCudartVersion();
if (cudnnCudartVersion != CUDART_VERSION) {
oss << " (built against CUDA ";
Expand All @@ -161,8 +170,8 @@ std::string CUDAHooks::showConfig() const {
}
oss << "\n";
if (cudnnVersion != CUDNN_VERSION) {
oss << " - Built with CuDNN ";
printCudaStyleVersion(CUDNN_VERSION);
oss << " - Built with CuDNN ";
printCudnnStyleVersion(CUDNN_VERSION);
oss << "\n";
}
#endif
Expand Down

0 comments on commit 7031394

Please sign in to comment.