Skip to content

cuDNN and pooling fixes #102

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Show file tree
Hide file tree
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
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