-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
cuDNN Wrapper. #3791
Conversation
enum class PoolingMode { | ||
kMaximum, | ||
kAverage, | ||
}; |
There was a problem hiding this comment.
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.
paddle/platform/cudnn_helper.cc
Outdated
See the License for the specific language governing permissions and | ||
limitations under the License. */ | ||
|
||
#include "paddle/platform/cudnn_helper.h" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove cudnn_helper.cc
paddle/platform/cudnn_helper.h
Outdated
|
||
#pragma once | ||
|
||
#ifndef PADDLE_ONLY_CPU |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
paddle/platform/cudnn_helper.h
Outdated
|
||
#ifndef PADDLE_ONLY_CPU | ||
#include <cudnn.h> | ||
#include "glog/logging.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <glog/logging.h>
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
paddle/platform/cudnn_helper_test.cc
Outdated
|
||
#include "paddle/platform/cudnn_helper.h" | ||
#include "glog/logging.h" | ||
#include "gtest/gtest.h" |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Fix #3731
cudnnTensorDescriptor_t
,cudnnConvolutionDescriptor_t
, ...