separate setConvolutionDesc from createConvolutionDesc
authorJonathan L Long <jonlong@cs.berkeley.edu>
Thu, 11 Sep 2014 06:15:22 +0000 (23:15 -0700)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Thu, 18 Sep 2014 19:41:46 +0000 (12:41 -0700)
include/caffe/util/cudnn.hpp

index aef3e21..aca5bd7 100644 (file)
@@ -88,10 +88,14 @@ inline void createFilterDesc(cudnnFilterDescriptor_t* desc,
 }
 
 template <typename Dtype>
-inline void createConvolutionDesc(cudnnConvolutionDescriptor_t* conv,
+inline void createConvolutionDesc(cudnnConvolutionDescriptor_t* conv) {
+  CUDNN_CHECK(cudnnCreateConvolutionDescriptor(conv));
+}
+
+template <typename Dtype>
+inline void setConvolutionDesc(cudnnConvolutionDescriptor_t* conv,
     cudnnTensor4dDescriptor_t bottom, cudnnFilterDescriptor_t filter,
     int pad_h, int pad_w, int stride_h, int stride_w) {
-  CUDNN_CHECK(cudnnCreateConvolutionDescriptor(conv));
   CUDNN_CHECK(cudnnSetConvolutionDescriptor(*conv, bottom, filter,
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
 }