Caffe2 - C++ API
A deep learning, cross platform ML framework
common_cudnn.cc
1 
17 #include "caffe2/core/common_cudnn.h"
18 #include "caffe2/core/cudnn_wrappers.h"
19 
20 #include "caffe2/core/init.h"
21 
22 namespace caffe2 {
23 
24 CuDNNWrapper::PerGPUCuDNNStates& CuDNNWrapper::cudnn_states() {
25  // New it (never delete) to avoid calling the destructors on process
26  // exit and racing against the CUDA shutdown sequence.
27  static auto* p = new CuDNNWrapper::PerGPUCuDNNStates();
28  CHECK_NOTNULL(p);
29  return *p;
30 }
31 
32 namespace {
33 bool PrintCuDNNInfo(int*, char***) {
34  VLOG(1) << "Caffe2 is built with CuDNN version " << CUDNN_VERSION;
35  return true;
36 }
37 
38 REGISTER_CAFFE2_INIT_FUNCTION(PrintCuDNNInfo, &PrintCuDNNInfo,
39  "Print CuDNN Info.");
40 
41 } // namespace
42 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.