Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
ea3ed9ae
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ea3ed9ae
编写于
4月 16, 2018
作者:
L
liuqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix max pooling opencl bug for mali gpu.
上级
47bff05a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
9 deletion
+25
-9
mace/core/runtime/opencl/opencl_runtime.cc
mace/core/runtime/opencl/opencl_runtime.cc
+22
-2
mace/kernels/opencl/cl/pooling.cl
mace/kernels/opencl/cl/pooling.cl
+0
-4
mace/ops/conv_2d_test.cc
mace/ops/conv_2d_test.cc
+3
-3
未找到文件。
mace/core/runtime/opencl/opencl_runtime.cc
浏览文件 @
ea3ed9ae
...
...
@@ -154,6 +154,15 @@ const std::string OpenCLErrorToString(cl_int error) {
}
}
namespace
{
void
CLCallback
(
const
char
*
buffer
,
size_t
length
,
size_t
final
,
void
*
user_data
)
{
fwrite
(
buffer
,
1
,
length
,
stdout
);
}
}
void
OpenCLProfilingTimer
::
StartTiming
()
{}
void
OpenCLProfilingTimer
::
StopTiming
()
{
...
...
@@ -299,8 +308,19 @@ OpenCLRuntime::OpenCLRuntime(GPUPerfHint gpu_perf_hint,
new
cl
::
Context
({
*
device_
},
context_properties
.
data
(),
nullptr
,
nullptr
,
&
err
));
}
else
{
context_
=
std
::
shared_ptr
<
cl
::
Context
>
(
new
cl
::
Context
({
*
device_
},
nullptr
,
nullptr
,
nullptr
,
&
err
));
if
(
is_profiling_enabled_
&&
gpu_type_
==
GPUType
::
MALI
)
{
std
::
vector
<
cl_context_properties
>
context_properties
=
{
CL_CONTEXT_PLATFORM
,
(
cl_context_properties
)
default_platform
(),
CL_PRINTF_CALLBACK_ARM
,
(
cl_context_properties
)
CLCallback
,
CL_PRINTF_BUFFERSIZE_ARM
,
0x1000
,
0
};
context_
=
std
::
shared_ptr
<
cl
::
Context
>
(
new
cl
::
Context
({
*
device_
},
context_properties
.
data
(),
nullptr
,
nullptr
,
&
err
));
}
else
{
context_
=
std
::
shared_ptr
<
cl
::
Context
>
(
new
cl
::
Context
({
*
device_
},
nullptr
,
nullptr
,
nullptr
,
&
err
));
}
}
MACE_CHECK_CL_SUCCESS
(
err
);
...
...
mace/kernels/opencl/cl/pooling.cl
浏览文件 @
ea3ed9ae
#
include
<common.h>
#
ifdef
FP16
#
define
MIN_VALUE
-USHRT_MAX
#
else
#
define
MIN_VALUE
-FLT_MAX
#
endif
inline
int
calculate_avg_block_size
(
const
int
pool_size,
const
int
pos_h,
...
...
mace/ops/conv_2d_test.cc
浏览文件 @
ea3ed9ae
...
...
@@ -416,7 +416,7 @@ void TestComplexConvNxNS12(const std::vector<index_t> &shape,
ImageToBuffer
<
D
,
T
>
(
&
net
,
"OutputImage"
,
"OPENCLOutput"
,
kernels
::
BufferType
::
IN_OUT_CHANNEL
);
ExpectTensorNear
<
float
>
(
expected
,
*
net
.
GetOutput
(
"OPENCLOutput"
),
1e-
5
,
1e-4
);
*
net
.
GetOutput
(
"OPENCLOutput"
),
1e-
4
,
1e-4
);
};
for
(
int
kernel_size
:
{
1
,
3
,
7
})
{
...
...
@@ -644,7 +644,7 @@ void TestDilationConvNxN(const std::vector<index_t> &shape,
ImageToBuffer
<
D
,
T
>
(
&
net
,
"OutputImage"
,
"OPENCLOutput"
,
kernels
::
BufferType
::
IN_OUT_CHANNEL
);
ExpectTensorNear
<
float
>
(
expected
,
*
net
.
GetOutput
(
"OPENCLOutput"
),
1e-
5
,
1e-4
);
1e-
4
,
1e-4
);
};
for
(
int
kernel_size
:
{
3
})
{
...
...
@@ -729,7 +729,7 @@ void TestArbitraryPadConvNxN(const std::vector<index_t> &shape,
ImageToBuffer
<
D
,
T
>
(
&
net
,
"OutputImage"
,
"OPENCLOutput"
,
kernels
::
BufferType
::
IN_OUT_CHANNEL
);
ExpectTensorNear
<
float
>
(
expected
,
*
net
.
GetOutput
(
"OPENCLOutput"
),
1e-
5
,
1e-4
);
1e-
4
,
1e-4
);
};
for
(
int
kernel_size
:
{
3
,
5
})
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录