Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
a564cbcb
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看板
提交
a564cbcb
编写于
10月 16, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add log info
上级
ebf7e03e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
3 deletion
+20
-3
src/framework/cl/cl_engine.h
src/framework/cl/cl_engine.h
+2
-0
src/framework/cl/cl_scope.h
src/framework/cl/cl_scope.h
+13
-0
src/io/api_paddle_mobile.cc
src/io/api_paddle_mobile.cc
+2
-0
src/io/paddle_inference_api.h
src/io/paddle_inference_api.h
+1
-1
src/operators/kernel/cl/cl_kernel/reshape.cl
src/operators/kernel/cl/cl_kernel/reshape.cl
+2
-2
未找到文件。
src/framework/cl/cl_engine.h
浏览文件 @
a564cbcb
...
@@ -88,6 +88,8 @@ class CLEngine {
...
@@ -88,6 +88,8 @@ class CLEngine {
return
true
;
return
true
;
}
}
cl_device_id
DeviceID
(
int
index
=
0
)
{
return
devices_
[
index
];
}
private:
private:
CLEngine
()
{
initialized_
=
false
;
}
CLEngine
()
{
initialized_
=
false
;
}
...
...
src/framework/cl/cl_scope.h
浏览文件 @
a564cbcb
...
@@ -58,11 +58,24 @@ class CLScope {
...
@@ -58,11 +58,24 @@ class CLScope {
auto
program
=
CLEngine
::
Instance
()
->
CreateProgramWith
(
auto
program
=
CLEngine
::
Instance
()
->
CreateProgramWith
(
context_
.
get
(),
"./cl_kernel/"
+
file_name
);
context_
.
get
(),
"./cl_kernel/"
+
file_name
);
DLOG
<<
" --- begin build program -> "
<<
file_name
<<
" --- "
;
status_
=
status_
=
clBuildProgram
(
program
.
get
(),
0
,
0
,
"-cl-fast-relaxed-math"
,
0
,
0
);
clBuildProgram
(
program
.
get
(),
0
,
0
,
"-cl-fast-relaxed-math"
,
0
,
0
);
CL_CHECK_ERRORS
(
status_
);
CL_CHECK_ERRORS
(
status_
);
if
(
status_
==
CL_BUILD_PROGRAM_FAILURE
)
{
size_t
log_size
;
clGetProgramBuildInfo
(
program
.
get
(),
CLEngine
::
Instance
()
->
DeviceID
(),
CL_PROGRAM_BUILD_LOG
,
0
,
NULL
,
&
log_size
);
char
*
log
=
(
char
*
)
malloc
(
log_size
);
clGetProgramBuildInfo
(
program
.
get
(),
CLEngine
::
Instance
()
->
DeviceID
(),
CL_PROGRAM_BUILD_LOG
,
log_size
,
log
,
NULL
);
DLOG
<<
" program build error: "
<<
log
;
}
DLOG
<<
" --- end build program -> "
<<
file_name
<<
" --- "
;
programs_
[
file_name
]
=
std
::
move
(
program
);
programs_
[
file_name
]
=
std
::
move
(
program
);
return
programs_
[
file_name
].
get
();
return
programs_
[
file_name
].
get
();
...
...
src/io/api_paddle_mobile.cc
浏览文件 @
a564cbcb
...
@@ -114,6 +114,8 @@ CreatePaddlePredictor<PaddleMobileConfig, PaddleEngineKind::kPaddleMobile>(
...
@@ -114,6 +114,8 @@ CreatePaddlePredictor<PaddleMobileConfig, PaddleEngineKind::kPaddleMobile>(
x
.
reset
(
new
PaddleMobilePredictor
<
FPGA
,
Precision
::
FP32
>
(
config
));
x
.
reset
(
new
PaddleMobilePredictor
<
FPGA
,
Precision
::
FP32
>
(
config
));
}
else
if
(
config
.
device
==
PaddleMobileConfig
::
kGPU_MALI
)
{
}
else
if
(
config
.
device
==
PaddleMobileConfig
::
kGPU_MALI
)
{
x
.
reset
(
new
PaddleMobilePredictor
<
GPU_MALI
,
Precision
::
FP32
>
(
config
));
x
.
reset
(
new
PaddleMobilePredictor
<
GPU_MALI
,
Precision
::
FP32
>
(
config
));
}
else
if
(
config
.
device
==
PaddleMobileConfig
::
kGPU_CL
)
{
x
.
reset
(
new
PaddleMobilePredictor
<
GPU_CL
,
Precision
::
FP32
>
(
config
));
}
else
{
}
else
{
LOG
(
kLOG_ERROR
)
<<
"unsupport device type!"
;
LOG
(
kLOG_ERROR
)
<<
"unsupport device type!"
;
return
nullptr
;
return
nullptr
;
...
...
src/io/paddle_inference_api.h
浏览文件 @
a564cbcb
...
@@ -111,7 +111,7 @@ class PaddlePredictor {
...
@@ -111,7 +111,7 @@ class PaddlePredictor {
struct
PaddleMobileConfig
:
public
PaddlePredictor
::
Config
{
struct
PaddleMobileConfig
:
public
PaddlePredictor
::
Config
{
enum
Precision
{
FP32
=
0
};
enum
Precision
{
FP32
=
0
};
enum
Device
{
kCPU
=
0
,
kFPGA
=
1
,
kGPU_MALI
=
2
};
enum
Device
{
kCPU
=
0
,
kFPGA
=
1
,
kGPU_MALI
=
2
,
kGPU_CL
=
3
};
enum
Precision
precision
;
enum
Precision
precision
;
enum
Device
device
;
enum
Device
device
;
...
...
src/operators/kernel/cl/cl_kernel/reshape.cl
浏览文件 @
a564cbcb
...
@@ -43,7 +43,7 @@ __kernel void reshape(__read_only image2d_t input,
...
@@ -43,7 +43,7 @@ __kernel void reshape(__read_only image2d_t input,
int
i0
=
oindex
;
int
i0
=
oindex
;
int
ix
=
(
i1
/
4
)
*
d3
+
i3
;
int
ix
=
(
i1
/
4
)
*
d3
+
i3
;
int
iy
=
i0
*
d2
+
i2
;
int
iy
=
i0
*
d2
+
i2
;
r[i]
=
read_imageh
(
input,
sampler,
int2
(
ix,
iy
))
[i1%4]
;
r[i]
=
read_imageh
(
input,
sampler,
(
int2
)
(
ix,
iy
))
[i1%4]
;
}
}
write_imageh
(
output,
int2
(
x,
y
)
,
r
)
;
write_imageh
(
output,
(
int2
)
(
x,
y
)
,
r
)
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录