Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
10fe3088
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
10fe3088
编写于
12月 19, 2016
作者:
G
gangliao
提交者:
GitHub
12月 19, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request
#949
from ccx0912/MY_COOL_STUFF_BRANCH
Added support for cudnn v6 and cuda 8.0
上级
e823c956
18ebeec2
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
42 addition
and
2 deletion
+42
-2
paddle/cuda/src/hl_cuda_cudnn.cc
paddle/cuda/src/hl_cuda_cudnn.cc
+42
-2
未找到文件。
paddle/cuda/src/hl_cuda_cudnn.cc
浏览文件 @
10fe3088
...
@@ -175,11 +175,15 @@ void hl_cudnn_init(cudnnHandle_t* cudnn_handle, cudaStream_t stream) {
...
@@ -175,11 +175,15 @@ void hl_cudnn_init(cudnnHandle_t* cudnn_handle, cudaStream_t stream) {
<<
"PaddlePaddle Requirement: "
<<
"PaddlePaddle Requirement: "
<<
"(header v[2-3] with libcudnn v[2-3]) Or "
<<
"(header v[2-3] with libcudnn v[2-3]) Or "
<<
"(header v4 with libcudnn v4) Or "
<<
"(header v4 with libcudnn v4) Or "
<<
"(header v5 with libcudnn v5)."
;
<<
"(header v5 with libcudnn v5) Or"
<<
"(header v6 with libcudnn v6)."
;
CHECK
(
!
(
CUDNN_VERSION
>=
5000
&&
CUDA_VERSION
<
7050
))
CHECK
(
!
(
CUDNN_VERSION
<
6000
&&
CUDNN_VERSION
>=
5000
&&
CUDA_VERSION
<
7050
))
<<
"cudnn v5 requires cuda version >= 7.5"
;
<<
"cudnn v5 requires cuda version >= 7.5"
;
CHECK
(
!
(
CUDNN_VERSION
>=
6000
&&
CUDA_VERSION
<
8000
))
<<
"cudnn v6 requires cuda version >= 8.0"
;
CHECK_CUDNN
(
dynload
::
cudnnCreate
(
cudnn_handle
));
CHECK_CUDNN
(
dynload
::
cudnnCreate
(
cudnn_handle
));
CHECK_CUDNN
(
dynload
::
cudnnSetStream
(
*
cudnn_handle
,
stream
));
CHECK_CUDNN
(
dynload
::
cudnnSetStream
(
*
cudnn_handle
,
stream
));
...
@@ -610,6 +614,23 @@ void hl_create_convolution_descriptor(hl_convolution_descriptor* conv,
...
@@ -610,6 +614,23 @@ void hl_create_convolution_descriptor(hl_convolution_descriptor* conv,
CHECK_CUDNN
(
dynload
::
cudnnCreateConvolutionDescriptor
(
&
hl_conv
->
desc
));
CHECK_CUDNN
(
dynload
::
cudnnCreateConvolutionDescriptor
(
&
hl_conv
->
desc
));
cudnnConvolutionMode_t
mode
=
CUDNN_CROSS_CORRELATION
;
cudnnConvolutionMode_t
mode
=
CUDNN_CROSS_CORRELATION
;
#if CUDNN_VERSION >= 6000
#ifndef PADDLE_TYPE_DOUBLE
cudnnDataType_t
data_type
=
CUDNN_DATA_FLOAT
;
#else
cudnnDataType_t
data_type
=
CUDNN_DATA_DOUBLE
;
#endif
CHECK_CUDNN
(
dynload
::
cudnnSetConvolution2dDescriptor
(
hl_conv
->
desc
,
padding_height
,
padding_width
,
stride_height
,
stride_width
,
1
,
1
,
mode
,
data_type
));
#else
CHECK_CUDNN
(
dynload
::
cudnnSetConvolution2dDescriptor
(
hl_conv
->
desc
,
CHECK_CUDNN
(
dynload
::
cudnnSetConvolution2dDescriptor
(
hl_conv
->
desc
,
padding_height
,
padding_height
,
padding_width
,
padding_width
,
...
@@ -618,6 +639,7 @@ void hl_create_convolution_descriptor(hl_convolution_descriptor* conv,
...
@@ -618,6 +639,7 @@ void hl_create_convolution_descriptor(hl_convolution_descriptor* conv,
1
,
1
,
1
,
1
,
mode
));
mode
));
#endif
hl_conv
->
input_image
=
image
;
hl_conv
->
input_image
=
image
;
hl_conv
->
filter
=
filter
;
hl_conv
->
filter
=
filter
;
...
@@ -645,6 +667,23 @@ void hl_reset_convolution_descriptor(hl_convolution_descriptor conv,
...
@@ -645,6 +667,23 @@ void hl_reset_convolution_descriptor(hl_convolution_descriptor conv,
cudnnConvolutionDescriptor_t
conv_desc
=
GET_CONVOLUTION_DESCRIPTOR
(
conv
);
cudnnConvolutionDescriptor_t
conv_desc
=
GET_CONVOLUTION_DESCRIPTOR
(
conv
);
cudnnConvolutionMode_t
mode
=
CUDNN_CROSS_CORRELATION
;
cudnnConvolutionMode_t
mode
=
CUDNN_CROSS_CORRELATION
;
#if CUDNN_VERSION >= 6000
#ifndef PADDLE_TYPE_DOUBLE
cudnnDataType_t
data_type
=
CUDNN_DATA_FLOAT
;
#else
cudnnDataType_t
data_type
=
CUDNN_DATA_DOUBLE
;
#endif
CHECK_CUDNN
(
dynload
::
cudnnSetConvolution2dDescriptor
(
conv_desc
,
padding_height
,
padding_width
,
stride_height
,
stride_width
,
1
,
1
,
mode
,
data_type
));
#else
CHECK_CUDNN
(
dynload
::
cudnnSetConvolution2dDescriptor
(
conv_desc
,
CHECK_CUDNN
(
dynload
::
cudnnSetConvolution2dDescriptor
(
conv_desc
,
padding_height
,
padding_height
,
padding_width
,
padding_width
,
...
@@ -653,6 +692,7 @@ void hl_reset_convolution_descriptor(hl_convolution_descriptor conv,
...
@@ -653,6 +692,7 @@ void hl_reset_convolution_descriptor(hl_convolution_descriptor conv,
1
,
1
,
1
,
1
,
mode
));
mode
));
#endif
cudnn_convolution_descriptor
hl_conv
=
(
cudnn_convolution_descriptor
)
conv
;
cudnn_convolution_descriptor
hl_conv
=
(
cudnn_convolution_descriptor
)
conv
;
hl_conv
->
input_image
=
image
;
hl_conv
->
input_image
=
image
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录