Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
518aca15
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看板
提交
518aca15
编写于
12月 17, 2018
作者:
H
hjchen2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix opencl compile
上级
d49d6147
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
24 deletion
+25
-24
src/framework/executor.cpp
src/framework/executor.cpp
+2
-3
src/io/paddle_mobile.cpp
src/io/paddle_mobile.cpp
+17
-17
src/operators/kernel/cl/feed_kernel.cpp
src/operators/kernel/cl/feed_kernel.cpp
+3
-2
src/operators/kernel/cl/fusion_fc_kernel.cpp
src/operators/kernel/cl/fusion_fc_kernel.cpp
+3
-2
未找到文件。
src/framework/executor.cpp
浏览文件 @
518aca15
...
...
@@ -456,9 +456,8 @@ void Executor<Device, T>::LoadMemory(const VarDesc var_desc, float *tensorInput,
char
**
data
)
{}
template
<
>
void
Executor
<
GPU_CL
,
Precision
::
FP32
>::
LoadMemory
(
const
VarDesc
var_desc
,
float
*
tensorInput
,
char
**
data
)
{
void
Executor
<
GPU_CL
,
float
>::
LoadMemory
(
const
VarDesc
var_desc
,
float
*
tensorInput
,
char
**
data
)
{
// 1. version
uint32_t
version
=
*
reinterpret_cast
<
uint32_t
*>
(
*
data
);
...
...
src/io/paddle_mobile.cpp
浏览文件 @
518aca15
...
...
@@ -202,50 +202,50 @@ double PaddleMobile<CPU, float>::GetPredictTime() {
#endif
#ifdef PADDLE_MOBILE_FPGA
template
<
typename
Device
,
T
P
>
void
PaddleMobile
<
Device
,
P
>::
InjectVariable
(
const
framework
::
Tensor
&
t
,
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
InjectVariable
(
const
framework
::
Tensor
&
t
,
std
::
string
var_name
)
{
executor_
->
InjectVariable
(
t
,
var_name
);
}
template
<
typename
Device
,
T
P
>
void
PaddleMobile
<
Device
,
P
>::
FeedData
(
const
framework
::
Tensor
&
t
)
{
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
FeedData
(
const
framework
::
Tensor
&
t
)
{
executor_
->
FeedData
(
t
);
}
template
<
typename
Device
,
T
P
>
std
::
shared_ptr
<
framework
::
Tensor
>
PaddleMobile
<
Device
,
P
>::
FetchResult
(
template
<
typename
Device
,
typename
T
>
std
::
shared_ptr
<
framework
::
Tensor
>
PaddleMobile
<
Device
,
T
>::
FetchResult
(
int
id
)
{
return
executor_
->
FetchResult
(
id
);
}
template
<
typename
Device
,
T
P
>
void
PaddleMobile
<
Device
,
P
>::
Predict_From_To
(
int
start
,
int
end
)
{
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
Predict_From_To
(
int
start
,
int
end
)
{
executor_
->
Predict_From_To
(
start
,
end
);
}
template
<
typename
Device
,
T
P
>
void
PaddleMobile
<
Device
,
P
>::
Predict_From
(
int
start
)
{
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
Predict_From
(
int
start
)
{
executor_
->
Predict_From
(
start
);
}
template
<
typename
Device
,
T
P
>
void
PaddleMobile
<
Device
,
P
>::
Predict_To
(
int
end
)
{
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
Predict_To
(
int
end
)
{
executor_
->
Predict_To
(
end
);
}
#endif
#ifdef PADDLE_MOBILE_CL
static
std
::
mutex
lc
;
template
<
typename
Device
,
T
P
>
void
PaddleMobile
<
Device
,
P
>::
SetCLPath
(
std
::
string
path
)
{
template
<
typename
Device
,
typename
T
>
void
PaddleMobile
<
Device
,
T
>::
SetCLPath
(
std
::
string
path
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
lc
);
if
(
framework
::
CLEngine
::
Instance
()
->
GetCLPath
()
==
""
)
{
framework
::
CLEngine
::
Instance
()
->
setClPath
(
path
);
}
}
template
<
>
double
PaddleMobile
<
GPU_CL
,
T
::
FP32
>::
GetPredictTime
()
{
double
PaddleMobile
<
GPU_CL
,
float
>::
GetPredictTime
()
{
cl_int
status
;
cl_uint
nPlatform
;
clGetPlatformIDs
(
0
,
NULL
,
&
nPlatform
);
...
...
@@ -443,8 +443,8 @@ double PaddleMobile<GPU_CL, T::FP32>::GetPredictTime() {
return
-
1
;
}
}
template
<
typename
Device
,
T
P
>
int
PaddleMobile
<
Device
,
P
>::
readText
(
template
<
typename
Device
,
typename
T
>
int
PaddleMobile
<
Device
,
T
>::
readText
(
const
char
*
kernelPath
,
char
**
pcode
)
{
// 读取文本文件放入 pcode,返回字符串长度
FILE
*
fp
;
...
...
src/operators/kernel/cl/feed_kernel.cpp
浏览文件 @
518aca15
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#include "operators/kernel/feed_kernel.h"
#include "framework/cl/cl_tensor.h"
namespace
paddle_mobile
{
namespace
operators
{
...
...
@@ -43,8 +44,8 @@ void FeedKernel<GPU_CL, float>::Compute(const FeedParam<GPU_CL> ¶m) {
const
int
Stride2
=
out_C
*
out_H
*
out_W
;
const
int
Stride1
=
out_H
*
out_W
;
const
int
Stride0
=
out_W
;
CLTensor
input_cl_tensor
(
this
->
cl_helper_
.
CLContext
(),
this
->
cl_helper_
.
CLCommandQueue
());
framework
::
CLTensor
input_cl_tensor
(
this
->
cl_helper_
.
CLContext
(),
this
->
cl_helper_
.
CLCommandQueue
());
input_cl_tensor
.
Resize
(
input
->
dims
());
cl_mem
inputBuffer
=
input_cl_tensor
.
mutable_with_data
<
float
>
(
input_data
);
...
...
src/operators/kernel/cl/fusion_fc_kernel.cpp
浏览文件 @
518aca15
...
...
@@ -94,8 +94,9 @@ void FusionFcCompute(const FusionFcParam<GPU_CL> ¶m, cl_context context,
memory
::
Copy
(
out_data
+
i
*
classes
,
input_z_data
,
sizeof
(
float
)
*
classes
);
}
math
::
MatMul
<
float
>
(
x_matrix
,
false
,
y_matrix
,
false
,
static_cast
<
float
>
(
1
),
out
,
static_cast
<
float
>
(
1
),
false
);
math
::
MatMul
<
float
,
float
>
(
x_matrix
,
false
,
y_matrix
,
false
,
static_cast
<
float
>
(
1
),
out
,
static_cast
<
float
>
(
1
),
false
);
out_image
->
InitEmptyImage
(
context
,
commandQueue
,
out
->
dims
());
framework
::
TensorToCLImage
(
out
,
out_image
,
context
,
commandQueue
,
kernel1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录