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 Wrapper. #3791

Merged
merged 6 commits into from
Sep 4, 2017
Merged

cuDNN Wrapper. #3791

merged 6 commits into from
Sep 4, 2017

Conversation

qingqing01
Copy link
Contributor

Fix #3731

  • Add cuDNN Wrapper for cudnnTensorDescriptor_t, cudnnConvolutionDescriptor_t , ...
    • all the descriptors for cuDNN are created in the constructor and destroyed in the destructor.
  • Add unit testing

@qingqing01 qingqing01 changed the title cuDNN Wrapper cuDNN Wrapper. Aug 31, 2017
enum class PoolingMode {
kMaximum,
kAverage,
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DataLayout and PoolingMode can be removed to other files when writing conv and pooling operators.

See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/platform/cudnn_helper.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need cudnn_helper.cc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove cudnn_helper.cc


#pragma once

#ifndef PADDLE_ONLY_CPU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need the PADDLE_ONLY_CPU macro. In this file, there is no code need to separate by this macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove #ifndef PADDLE_ONLY_CPU


#ifndef PADDLE_ONLY_CPU
#include <cudnn.h>
#include "glog/logging.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <glog/logging.h>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove #include <glog/logging.h>, it is used to debug at first.

template <>
class CudnnDataType<float> {
public:
static const cudnnDataType_t type = CUDNN_DATA_FLOAT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 45-53 can be written in the template CudnnDataType.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These codes may be not necessary and remove them.


#include "paddle/platform/cudnn_helper.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <glog/logging.h>
#include <gtest/gtest.h>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

enum class DataLayout {
kNHWC,
kNCHW,
kNCHW_VECT_C,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the cudnn's three-dimensional convolution be taken into account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layout for 3D Conv can be added when implementing it.

@qingqing01 qingqing01 merged commit 3542027 into PaddlePaddle:develop Sep 4, 2017
@qingqing01 qingqing01 deleted the cudnn_wrapper branch November 14, 2019 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants