Skip to content

Commit

Permalink
Merge pull request BVLC#102 from drnikolaev/pooling-cudnn-fixes
Browse files Browse the repository at this point in the history
cuDNN and pooling fixes
  • Loading branch information
borisfom committed Jan 19, 2016
2 parents 8eebbb4 + 569aa49 commit b3a4a1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/caffe/layer_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ shared_ptr<Layer<Dtype> > GetPoolingLayer(const LayerParameter& param) {
#ifdef USE_CUDNN
} else if (engine == PoolingParameter_Engine_CUDNN) {
PoolingParameter p_param = param.pooling_param();

// FIXME We assume that precision issue will be fixed in cuDNN v5.0
#if CUDNN_VERSION >= 5000
return shared_ptr<Layer<Dtype> >(new CuDNNPoolingLayer<Dtype>(param));
#else
return shared_ptr<Layer<Dtype> >(new PoolingLayer<Dtype>(param));
#endif

#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
Expand Down
4 changes: 4 additions & 0 deletions src/caffe/layers/cudnn_batch_norm_layer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ void CuDNNBatchNormLayer<Dtype>::Backward_gpu(
mode_,
cudnn::dataType<Dtype>::one,
cudnn::dataType<Dtype>::zero,
#if CUDNN_VERSION >= 4005
cudnn::dataType<Dtype>::one,
cudnn::dataType<Dtype>::zero,
#endif
bottom_desc_,
bottom_data,
bottom_desc_,
Expand Down

0 comments on commit b3a4a1a

Please sign in to comment.