Skip to content
Merged
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
15 changes: 8 additions & 7 deletions src/caffe/layer_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ shared_ptr<Layer<Dtype> > GetPoolingLayer(const LayerParameter& param) {
} 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

// CuDNN handles tie breaks differently than Caffe for MaxPooling.
// Until there is a workaround in Caffe (index management) or cuDNN,
// use Caffe layer to max pooling
if (param.pooling_param().pool() == PoolingParameter_PoolMethod_MAX) {
return shared_ptr<Layer<Dtype> >(new PoolingLayer<Dtype>(param));
} else {
return shared_ptr<Layer<Dtype> >(new CuDNNPoolingLayer<Dtype>(param));
}
#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
Expand Down