Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
585c0cee
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,发现更多精彩内容 >>
提交
585c0cee
编写于
3月 29, 2018
作者:
U
Unknown
提交者:
liutuo
3月 29, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cpplint check
上级
b41f6418
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
10 deletion
+7
-10
mace/kernels/eltwise.h
mace/kernels/eltwise.h
+6
-6
mace/kernels/opencl/depth_to_space_opencl.cc
mace/kernels/opencl/depth_to_space_opencl.cc
+0
-3
mace/kernels/opencl/eltwise_opencl.cc
mace/kernels/opencl/eltwise_opencl.cc
+1
-1
未找到文件。
mace/kernels/eltwise.h
浏览文件 @
585c0cee
...
...
@@ -41,7 +41,7 @@ struct EltwiseFunctor : EltwiseFunctorBase {
StatsFuture
*
future
)
{
Tensor
::
MappingGuard
input0_guard
(
input0
);
Tensor
::
MappingGuard
input1_guard
(
input1
);
Tensor
::
MappingGuard
output_guard
(
output
);
Tensor
::
MappingGuard
output_guard
(
output
);
const
T
*
input0_ptr
=
input0
->
data
<
T
>
();
const
T
*
input1_ptr
=
input1
->
data
<
T
>
();
...
...
@@ -56,12 +56,12 @@ struct EltwiseFunctor : EltwiseFunctorBase {
}
break
;
case
SUM
:
if
(
coeff_
.
empty
())
{
if
(
coeff_
.
empty
())
{
#pragma omp parallel for
for
(
index_t
i
=
0
;
i
<
size
;
++
i
)
{
for
(
index_t
i
=
0
;
i
<
size
;
++
i
)
{
output_ptr
[
i
]
=
input0_ptr
[
i
]
+
input1_ptr
[
i
];
}
}
else
{
}
else
{
#pragma omp parallel for
for
(
index_t
i
=
0
;
i
<
size
;
++
i
)
{
output_ptr
[
i
]
=
...
...
@@ -69,13 +69,13 @@ struct EltwiseFunctor : EltwiseFunctorBase {
}
}
break
;
case
MAX
:
case
MAX
:
#pragma omp parallel for
for
(
index_t
i
=
0
;
i
<
size
;
++
i
)
{
output_ptr
[
i
]
=
std
::
max
<
T
>
(
input0_ptr
[
i
],
input1_ptr
[
i
]);
}
break
;
case
MIN
:
case
MIN
:
#pragma omp parallel for
for
(
index_t
i
=
0
;
i
<
size
;
++
i
)
{
output_ptr
[
i
]
=
std
::
min
<
T
>
(
input0_ptr
[
i
],
input1_ptr
[
i
]);
...
...
mace/kernels/opencl/depth_to_space_opencl.cc
浏览文件 @
585c0cee
...
...
@@ -21,7 +21,6 @@ void DepthToSpaceOpFunctor<DeviceType::OPENCL, T>::operator()(
const
index_t
input_depth
=
input
->
dim
(
3
);
const
char
*
kernel_name
=
nullptr
;
index_t
kernel_width
=
input_width
;
index_t
output_height
,
output_width
,
output_depth
;
if
(
d2s_
)
{
...
...
@@ -29,13 +28,11 @@ void DepthToSpaceOpFunctor<DeviceType::OPENCL, T>::operator()(
output_width
=
input_width
*
block_size_
;
output_depth
=
input_depth
/
(
block_size_
*
block_size_
);
kernel_name
=
"depth_to_space"
;
kernel_width
=
output_width
;
}
else
{
output_height
=
input_height
/
block_size_
;
output_width
=
input_width
/
block_size_
;
output_depth
=
input_depth
*
block_size_
*
block_size_
;
kernel_name
=
"space_to_depth"
;
kernel_width
=
input_width
;
}
const
index_t
input_depth_blocks
=
RoundUpDiv4
(
input_depth
);
const
index_t
output_depth_blocks
=
RoundUpDiv4
(
output_depth
);
...
...
mace/kernels/opencl/eltwise_opencl.cc
浏览文件 @
585c0cee
...
...
@@ -22,7 +22,7 @@ void EltwiseFunctor<DeviceType::OPENCL, T>::operator()(const Tensor *input0,
const
index_t
channel_blocks
=
RoundUpDiv4
(
channels
);
const
index_t
width_pixels
=
channel_blocks
*
width
;
const
index_t
batch_height_pixels
=
batch
*
height
;
const
index_t
batch_height_pixels
=
batch
*
height
;
const
uint32_t
gws
[
2
]
=
{
static_cast
<
uint32_t
>
(
width_pixels
),
static_cast
<
uint32_t
>
(
batch_height_pixels
)};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录