Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
508ca98b
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
508ca98b
编写于
10月 12, 2019
作者:
J
Jiaying Zhao
提交者:
GitHub
10月 12, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix clang compile error. test=develop (#2180)
上级
a6b1e4fa
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
19 deletion
+20
-19
mobile/src/framework/cl/cl_helper.h
mobile/src/framework/cl/cl_helper.h
+6
-6
mobile/src/framework/cl/cl_image.cpp
mobile/src/framework/cl/cl_image.cpp
+2
-2
mobile/src/framework/cl/cl_image.h
mobile/src/framework/cl/cl_image.h
+3
-2
mobile/src/operators/kernel/cl/elementwise_add_kernel.cpp
mobile/src/operators/kernel/cl/elementwise_add_kernel.cpp
+4
-4
mobile/src/operators/kernel/cl/prior_box_kernel.cpp
mobile/src/operators/kernel/cl/prior_box_kernel.cpp
+3
-3
mobile/test/net/test_net.cpp
mobile/test/net/test_net.cpp
+2
-2
未找到文件。
mobile/src/framework/cl/cl_helper.h
浏览文件 @
508ca98b
...
@@ -66,9 +66,9 @@ class CLHelper {
...
@@ -66,9 +66,9 @@ class CLHelper {
auto
h
=
image_dim
[
2
];
auto
h
=
image_dim
[
2
];
auto
w
=
image_dim
[
3
];
auto
w
=
image_dim
[
3
];
auto
image_width
=
image
.
ImageWidth
();
auto
image_width
=
image
.
ImageWidth
();
auto
work_size_0
=
image_width
/
w
;
size_t
work_size_0
=
image_width
/
w
;
auto
work_size_1
=
w
;
size_t
work_size_1
=
w
;
auto
work_size_2
=
n
*
h
;
size_t
work_size_2
=
n
*
h
;
return
{
work_size_0
,
work_size_1
,
work_size_2
};
return
{
work_size_0
,
work_size_1
,
work_size_2
};
}
else
if
(
image_dim
.
size
()
==
2
)
{
}
else
if
(
image_dim
.
size
()
==
2
)
{
auto
h
=
image_dim
[
0
];
auto
h
=
image_dim
[
0
];
...
@@ -77,9 +77,9 @@ class CLHelper {
...
@@ -77,9 +77,9 @@ class CLHelper {
}
else
if
(
image_dim
.
size
()
==
1
)
{
}
else
if
(
image_dim
.
size
()
==
1
)
{
return
{
1
,
image
.
ImageWidth
(),
1
};
return
{
1
,
image
.
ImageWidth
(),
1
};
}
else
if
(
image_dim
.
size
()
==
3
)
{
}
else
if
(
image_dim
.
size
()
==
3
)
{
in
t
c
=
image_dim
[
0
];
size_
t
c
=
image_dim
[
0
];
in
t
h
=
image_dim
[
1
];
size_
t
h
=
image_dim
[
1
];
in
t
w
=
image_dim
[
2
];
size_
t
w
=
image_dim
[
2
];
return
{(
c
+
3
)
/
4
,
w
,
h
};
return
{(
c
+
3
)
/
4
,
w
,
h
};
}
}
PADDLE_MOBILE_THROW_EXCEPTION
(
" not support this dim, need imp "
);
PADDLE_MOBILE_THROW_EXCEPTION
(
" not support this dim, need imp "
);
...
...
mobile/src/framework/cl/cl_image.cpp
浏览文件 @
508ca98b
...
@@ -119,8 +119,8 @@ void TensorToCLImage(Tensor *tensor, CLImage *cl_image, cl_context context,
...
@@ -119,8 +119,8 @@ void TensorToCLImage(Tensor *tensor, CLImage *cl_image, cl_context context,
#ifdef PADDLE_MOBILE_DEBUG
#ifdef PADDLE_MOBILE_DEBUG
Print
&
operator
<<
(
Print
&
printer
,
const
CLImage
&
cl_image
)
{
Print
&
operator
<<
(
Print
&
printer
,
const
CLImage
&
cl_image
)
{
in
t
width
=
cl_image
.
ImageDims
()[
0
];
size_
t
width
=
cl_image
.
ImageDims
()[
0
];
in
t
height
=
cl_image
.
ImageDims
()[
1
];
size_
t
height
=
cl_image
.
ImageDims
()[
1
];
half_t
*
image_data
=
new
half_t
[
height
*
width
*
4
];
half_t
*
image_data
=
new
half_t
[
height
*
width
*
4
];
cl_int
err
;
cl_int
err
;
...
...
mobile/src/framework/cl/cl_image.h
浏览文件 @
508ca98b
...
@@ -177,7 +177,7 @@ class CLImage {
...
@@ -177,7 +177,7 @@ class CLImage {
* init cl mem with a exist cl mem
* init cl mem with a exist cl mem
*/
*/
void
InitWithExistMem
(
cl_context
context
,
cl_command_queue
command_queue
,
void
InitWithExistMem
(
cl_context
context
,
cl_command_queue
command_queue
,
DDim
need_dims
,
CLImage
&
src
)
{
DDim
need_dims
,
const
CLImage
&
src
)
{
CLImageConverterNormal
*
normal_converter
=
new
CLImageConverterNormal
();
CLImageConverterNormal
*
normal_converter
=
new
CLImageConverterNormal
();
real_image_dims_
=
src
.
real_image_dims_
;
real_image_dims_
=
src
.
real_image_dims_
;
...
@@ -271,7 +271,8 @@ class CLImage {
...
@@ -271,7 +271,8 @@ class CLImage {
CLImageConverterBase
*
Converter
()
const
{
return
image_converter_
;
}
CLImageConverterBase
*
Converter
()
const
{
return
image_converter_
;
}
private:
private:
void
InitCLImage
(
cl_context
context
,
int
width
,
int
height
,
void
*
data
)
{
void
InitCLImage
(
cl_context
context
,
size_t
width
,
size_t
height
,
void
*
data
)
{
cl_image_format
cf
=
{.
image_channel_order
=
CL_RGBA
,
cl_image_format
cf
=
{.
image_channel_order
=
CL_RGBA
,
.
image_channel_data_type
=
CL_HALF_FLOAT
};
.
image_channel_data_type
=
CL_HALF_FLOAT
};
cl_image_desc
cid
=
{
cl_image_desc
cid
=
{
...
...
mobile/src/operators/kernel/cl/elementwise_add_kernel.cpp
浏览文件 @
508ca98b
...
@@ -77,8 +77,8 @@ void ElementwiseAddKernel<GPU_CL, float>::Compute(
...
@@ -77,8 +77,8 @@ void ElementwiseAddKernel<GPU_CL, float>::Compute(
status
=
clSetKernelArg
(
kernel
,
2
,
sizeof
(
cl_mem
),
status
=
clSetKernelArg
(
kernel
,
2
,
sizeof
(
cl_mem
),
reinterpret_cast
<
void
*>
(
&
output_image
));
reinterpret_cast
<
void
*>
(
&
output_image
));
CL_CHECK_ERRORS
(
status
);
CL_CHECK_ERRORS
(
status
);
int
width
=
input
->
ImageWidth
();
auto
width
=
input
->
ImageWidth
();
int
height
=
input
->
ImageHeight
();
auto
height
=
input
->
ImageHeight
();
size_t
global_work_size
[
2
]
=
{
width
,
height
};
size_t
global_work_size
[
2
]
=
{
width
,
height
};
status
=
status
=
clEnqueueNDRangeKernel
(
this
->
cl_helper_
.
CLCommandQueue
(),
kernel
,
2
,
clEnqueueNDRangeKernel
(
this
->
cl_helper_
.
CLCommandQueue
(),
kernel
,
2
,
...
@@ -103,8 +103,8 @@ void ElementwiseAddKernel<GPU_CL, float>::Compute(
...
@@ -103,8 +103,8 @@ void ElementwiseAddKernel<GPU_CL, float>::Compute(
status
=
clSetKernelArg
(
kernel
,
3
,
sizeof
(
cl_int
),
status
=
clSetKernelArg
(
kernel
,
3
,
sizeof
(
cl_int
),
reinterpret_cast
<
void
*>
(
&
tensor_w
));
reinterpret_cast
<
void
*>
(
&
tensor_w
));
CL_CHECK_ERRORS
(
status
);
CL_CHECK_ERRORS
(
status
);
int
width
=
input
->
ImageWidth
();
auto
width
=
input
->
ImageWidth
();
int
height
=
input
->
ImageHeight
();
auto
height
=
input
->
ImageHeight
();
DLOG
<<
"dede:"
<<
width
<<
","
<<
height
;
DLOG
<<
"dede:"
<<
width
<<
","
<<
height
;
size_t
global_work_size
[
2
]
=
{
width
,
height
};
size_t
global_work_size
[
2
]
=
{
width
,
height
};
cl_event
out_event
=
param
.
Out
()
->
GetClEvent
();
cl_event
out_event
=
param
.
Out
()
->
GetClEvent
();
...
...
mobile/src/operators/kernel/cl/prior_box_kernel.cpp
浏览文件 @
508ca98b
...
@@ -121,9 +121,9 @@ void PriorBoxKernel<GPU_CL, float>::Compute(
...
@@ -121,9 +121,9 @@ void PriorBoxKernel<GPU_CL, float>::Compute(
auto
kernel
=
this
->
cl_helper_
.
KernelAt
(
0
);
auto
kernel
=
this
->
cl_helper_
.
KernelAt
(
0
);
auto
default_work_size
=
auto
default_work_size
=
this
->
cl_helper_
.
DefaultWorkSize
(
*
param
.
OutputBoxes
());
this
->
cl_helper_
.
DefaultWorkSize
(
*
param
.
OutputBoxes
());
int
c_block
=
default_work_size
[
0
];
auto
c_block
=
default_work_size
[
0
];
int
w
=
default_work_size
[
1
];
auto
w
=
default_work_size
[
1
];
int
nh
=
default_work_size
[
2
];
auto
nh
=
default_work_size
[
2
];
std
::
vector
<
int64_t
>
box_shape
({
num_priors
});
std
::
vector
<
int64_t
>
box_shape
({
num_priors
});
framework
::
DDim
ddim
=
framework
::
make_ddim
(
box_shape
);
framework
::
DDim
ddim
=
framework
::
make_ddim
(
box_shape
);
...
...
mobile/test/net/test_net.cpp
浏览文件 @
508ca98b
...
@@ -185,8 +185,8 @@ void test(int argc, char *argv[]) {
...
@@ -185,8 +185,8 @@ void test(int argc, char *argv[]) {
if
(
len
==
0
)
{
if
(
len
==
0
)
{
continue
;
continue
;
}
}
in
t
width
=
cl_image
->
ImageDims
()[
0
];
size_
t
width
=
cl_image
->
ImageDims
()[
0
];
in
t
height
=
cl_image
->
ImageDims
()[
1
];
size_
t
height
=
cl_image
->
ImageDims
()[
1
];
paddle_mobile
::
framework
::
half_t
*
image_data
=
paddle_mobile
::
framework
::
half_t
*
image_data
=
new
paddle_mobile
::
framework
::
half_t
[
height
*
width
*
4
];
new
paddle_mobile
::
framework
::
half_t
[
height
*
width
*
4
];
cl_int
err
;
cl_int
err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录