Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

cuDNN R2 #2038

Merged
merged 4 commits into from
Mar 24, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
cuDNN pooling can pad now
  • Loading branch information
shelhamer committed Mar 24, 2015
commit 6d1444fea9d701cbe3e1e9fa3216edc96979d41c
6 changes: 2 additions & 4 deletions src/caffe/layers/cudnn_pooling_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ template <typename Dtype>
void CuDNNPoolingLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
PoolingLayer<Dtype>::LayerSetUp(bottom, top);
// Sanity check: CUDNN currently only supports pad == 0.
CHECK_EQ(this->pad_h_, 0);
CHECK_EQ(this->pad_w_, 0);
CUDNN_CHECK(cudnnCreate(&handle_));
cudnn::createTensor4dDesc<Dtype>(&bottom_desc_);
cudnn::createTensor4dDesc<Dtype>(&top_desc_);
cudnn::createPoolingDesc<Dtype>(&pooling_desc_,
this->layer_param_.pooling_param().pool(), &mode_,
this->kernel_h_, this->kernel_w_, this->stride_h_, this->stride_w_);
this->kernel_h_, this->kernel_w_, this->pad_h_, this->pad_w_,
this->stride_h_, this->stride_w_);
handles_setup_ = true;
}

Expand Down
8 changes: 0 additions & 8 deletions src/caffe/test/test_pooling_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,6 @@ TYPED_TEST(CuDNNPoolingLayerTest, TestSetupCuDNN) {
EXPECT_EQ(this->blob_top_->width(), 2);
}

// This test and all following cuDNN pooling tests with padding are commented
// for now, since cuDNN pooling does not currently support padding.
/*
TYPED_TEST(CuDNNPoolingLayerTest, TestSetupPaddedCuDNN) {
Caffe::set_mode(Caffe::GPU);
LayerParameter layer_param;
Expand All @@ -994,7 +991,6 @@ TYPED_TEST(CuDNNPoolingLayerTest, TestSetupPaddedCuDNN) {
EXPECT_EQ(this->blob_top_->height(), 4);
EXPECT_EQ(this->blob_top_->width(), 3);
}
*/

/*
TYPED_TEST(CuDNNPoolingLayerTest, PrintBackwardCuDNN) {
Expand Down Expand Up @@ -1062,7 +1058,6 @@ TYPED_TEST(CuDNNPoolingLayerTest, TestGradientMaxCuDNN) {
}
}

/*
TYPED_TEST(CuDNNPoolingLayerTest, TestForwardMaxPaddedCuDNN) {
Caffe::set_mode(Caffe::GPU);
LayerParameter layer_param;
Expand Down Expand Up @@ -1107,7 +1102,6 @@ TYPED_TEST(CuDNNPoolingLayerTest, TestForwardMaxPaddedCuDNN) {
EXPECT_NEAR(this->blob_top_->cpu_data()[7], 4, epsilon);
EXPECT_NEAR(this->blob_top_->cpu_data()[8], 1, epsilon);
}
*/

/*
TYPED_TEST(CuDNNPoolingLayerTest, TestGradientMaxTopMaskCuDNN) {
Expand Down Expand Up @@ -1175,7 +1169,6 @@ TYPED_TEST(CuDNNPoolingLayerTest, TestGradientAveCuDNN) {
}
}

/*
TYPED_TEST(CuDNNPoolingLayerTest, TestGradientAvePaddedCuDNN) {
Caffe::set_mode(Caffe::GPU);
for (int kernel_h = 3; kernel_h <= 4; kernel_h++) {
Expand All @@ -1194,7 +1187,6 @@ TYPED_TEST(CuDNNPoolingLayerTest, TestGradientAvePaddedCuDNN) {
}
}
}
*/

#endif

Expand Down