Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9eca4942
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看板
提交
9eca4942
编写于
10月 15, 2018
作者:
R
Ray Liu
提交者:
GitHub
10月 15, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1092 from codeWorm2015/opencl
update relu kernel
上级
408407f4
b83becca
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
18 deletion
+10
-18
src/framework/executor.cpp
src/framework/executor.cpp
+1
-1
src/operators/kernel/cl/cl_kernel/relu.cl
src/operators/kernel/cl/cl_kernel/relu.cl
+8
-16
src/operators/kernel/cl/feed_kernel.cpp
src/operators/kernel/cl/feed_kernel.cpp
+1
-1
未找到文件。
src/framework/executor.cpp
浏览文件 @
9eca4942
...
...
@@ -37,7 +37,7 @@ limitations under the License. */
#include "framework/cl/cl_image.h"
#endif
int
debug_to
=
4
;
int
debug_to
=
5
;
namespace
paddle_mobile
{
namespace
framework
{
...
...
src/operators/kernel/cl/cl_kernel/relu.cl
浏览文件 @
9eca4942
/*
Copyright
(
c
)
2018
PaddlePaddle
Authors.
All
Rights
Reserved.
Licensed
under
the
Apache
License,
Version
2.0
(
the
"License"
)
;
you
may
not
use
this
file
except
in
compliance
with
the
License.
You
may
obtain
a
copy
of
the
License
at
http://www.apache.org/licenses/LICENSE-2.0
Unless
required
by
applicable
law
or
agreed
to
in
writing,
software
distributed
under
the
License
is
distributed
on
an
"AS IS"
BASIS,
WITHOUT
WARRANTIES
OR
CONDITIONS
OF
ANY
KIND,
either
express
or
implied.
See
the
License
for
the
specific
language
governing
permissions
and
limitations
under
the
License.
*/
#
pragma
OPENCL
EXTENSION
cl_khr_fp16
:
enable
__kernel
void
relu
(
__read_only
image2d_t
input,
__write_only
image2d_t
output
)
__write_only
image2d_t
output
)
{
const
int
x
=
get_global_id
(
0
)
;
const
int
y
=
get_global_id
(
1
)
;
const
sampler_t
sampler
=
CLK_NORMALIZED_COORDS_TRUE
|
CLK_ADDRESS_CLAMP |
CLK_FILTER_NEAREST
;
half4
r
=
read_imageh
(
input,
sampler,
int2
(
x,
y
))
;
r
=
max
(
half4
(
0
,
0
,
0
,
0
)
,
r
)
;
write_imageh
(
output,
int2
(
x,
y
)
,
r
)
;
half4
in
=
read_imageh
(
input,
sampler,
(
int2
)(
x,
y
))
;
in
=
max
((
half4
)(
0.0
)
,
in
)
;
write_imageh
(
output,
(
int2
)(
x,
y
)
,
in
)
;
}
\ No newline at end of file
src/operators/kernel/cl/feed_kernel.cpp
浏览文件 @
9eca4942
...
...
@@ -61,7 +61,7 @@ void FeedKernel<GPU_CL, float>::Compute(const FeedParam<GPU_CL> ¶m) {
size_t
region
[
3
]
=
{
height
,
width
,
1
};
clEnqueueReadImage
(
commandQueue
,
cl_image
,
CL_TRUE
,
origin
,
region
,
0
,
0
,
out
,
0
,
NULL
,
NULL
);
// for (int i = 0; i < numel; i++) DLOG << Half2Float(out[i]);
// for (int i = 0; i < numel; i++) DLOG << Half2Float(out[i]);
}
template
class
FeedKernel
<
GPU_CL
,
float
>;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录