Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
76b02b7c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
76b02b7c
编写于
6月 17, 2022
作者:
Z
zhoutianzi666
提交者:
GitHub
6月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile fail in cuda11.6 (#43559)
上级
1a1d596b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
14 deletion
+10
-14
paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.h
paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.h
+0
-2
paddle/fluid/inference/tensorrt/plugin/split_op_plugin.cu
paddle/fluid/inference/tensorrt/plugin/split_op_plugin.cu
+10
-8
paddle/fluid/inference/tensorrt/plugin/split_op_plugin.h
paddle/fluid/inference/tensorrt/plugin/split_op_plugin.h
+0
-4
未找到文件。
paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.h
浏览文件 @
76b02b7c
...
...
@@ -14,8 +14,6 @@
#pragma once
#include <thrust/device_vector.h>
#include <string>
#include <utility>
#include <vector>
...
...
paddle/fluid/inference/tensorrt/plugin/split_op_plugin.cu
浏览文件 @
76b02b7c
...
...
@@ -13,6 +13,7 @@
// limitations under the License.
#include <cuda_fp16.h>
#include <thrust/device_vector.h>
#include <algorithm>
...
...
@@ -63,9 +64,7 @@ void SplitPlugin::shareData(const SplitPlugin* another) {
inner_cols_
=
another
->
inner_cols_
;
same_shape_
=
another
->
same_shape_
;
axis_shape_
=
another
->
axis_shape_
;
d_segment_offsets_
=
another
->
d_segment_offsets_
;
segment_offsets_
=
another
->
segment_offsets_
;
d_output_ptrs_
.
resize
(
another
->
d_output_ptrs_
.
size
(),
nullptr
);
}
int
SplitPlugin
::
initialize
()
TRT_NOEXCEPT
{
...
...
@@ -93,9 +92,7 @@ int SplitPlugin::initialize() TRT_NOEXCEPT {
segment_offsets
.
push_back
(
segment_offsets
.
back
()
+
output_length_
[
i
]);
}
axis_shape_
=
dims
.
d
[
axis_
];
d_segment_offsets_
=
segment_offsets
;
segment_offsets_
=
std
::
move
(
segment_offsets
);
d_output_ptrs_
.
resize
(
this
->
getNbOutputs
(),
nullptr
);
return
0
;
}
...
...
@@ -133,13 +130,18 @@ int SplitPlugin::enqueue(int batchSize, const void* const* inputs,
void
*
const
*
outputs
,
void
*
workspace
,
cudaStream_t
stream
)
TRT_NOEXCEPT
{
#endif
// this two thrust variables decalared here , not with in .h
// to avoid compiling error in cuda 11.6
thrust
::
device_vector
<
int
>
d_segment_offsets
=
segment_offsets_
;
thrust
::
device_vector
<
float
*>
d_output_ptrs
;
d_output_ptrs
.
resize
(
segment_offsets_
.
size
(),
nullptr
);
const
int
*
d_segment_offsets_ptr
=
thrust
::
raw_pointer_cast
(
&
d_segment_offsets
_
[
0
]);
thrust
::
raw_pointer_cast
(
&
d_segment_offsets
[
0
]);
float
const
*
input_ptr
=
reinterpret_cast
<
float
const
*>
(
inputs
[
0
]);
float
*
const
*
h_odatas
=
reinterpret_cast
<
float
*
const
*>
(
outputs
);
float
**
output_ptrs
=
thrust
::
raw_pointer_cast
(
&
d_output_ptrs
_
[
0
]);
float
**
output_ptrs
=
thrust
::
raw_pointer_cast
(
&
d_output_ptrs
[
0
]);
PADDLE_ENFORCE_GPU_SUCCESS
(
cudaMemcpyAsync
(
output_ptrs
,
h_odatas
,
d_output_ptrs
_
.
size
()
*
sizeof
(
float
*
),
output_ptrs
,
h_odatas
,
d_output_ptrs
.
size
()
*
sizeof
(
float
*
),
cudaMemcpyHostToDevice
,
stream
));
int
outer_rows
=
outer_rows_
*
batchSize
;
...
...
@@ -150,7 +152,7 @@ int SplitPlugin::enqueue(int batchSize, const void* const* inputs,
std
::
min
((
outer_rows_
-
1
)
/
block
.
z
+
1
,
65535u
));
split_kernel
<<<
grid
,
block
,
0
,
stream
>>>
(
d_
segment_offsets_
.
size
(),
d_segment_offsets_ptr
,
input_ptr
,
output_ptrs
,
segment_offsets_
.
size
(),
d_segment_offsets_ptr
,
input_ptr
,
output_ptrs
,
inner_cols_
,
axis_shape_
,
outer_rows
);
return
cudaGetLastError
()
!=
cudaSuccess
;
}
...
...
paddle/fluid/inference/tensorrt/plugin/split_op_plugin.h
浏览文件 @
76b02b7c
...
...
@@ -14,8 +14,6 @@
#pragma once
#include <thrust/device_vector.h>
#include <string>
#include <utility>
#include <vector>
...
...
@@ -94,8 +92,6 @@ class SplitPlugin : public PluginTensorRTV2Ext {
bool
same_shape_
;
std
::
vector
<
int
>
output_length_
;
std
::
vector
<
int
>
segment_offsets_
;
thrust
::
device_vector
<
int
>
d_segment_offsets_
;
thrust
::
device_vector
<
float
*>
d_output_ptrs_
;
private:
void
shareData
(
const
SplitPlugin
*
another
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录