Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
bf8531f2
Mace
项目概览
Xiaomi
/
Mace
通知
107
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看板
提交
bf8531f2
编写于
12月 18, 2017
作者:
L
Liangliang He
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix opencl future nullptr issue
上级
f50ea028
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
105 addition
and
79 deletion
+105
-79
mace/kernels/opencl/addn.cc
mace/kernels/opencl/addn.cc
+8
-6
mace/kernels/opencl/batch_norm_opencl.cc
mace/kernels/opencl/batch_norm_opencl.cc
+8
-6
mace/kernels/opencl/bias_add_opencl.cc
mace/kernels/opencl/bias_add_opencl.cc
+8
-6
mace/kernels/opencl/buffer_to_image.cc
mace/kernels/opencl/buffer_to_image.cc
+8
-6
mace/kernels/opencl/concat.cc
mace/kernels/opencl/concat.cc
+8
-6
mace/kernels/opencl/conv_2d_opencl_1x1.cc
mace/kernels/opencl/conv_2d_opencl_1x1.cc
+8
-6
mace/kernels/opencl/conv_2d_opencl_3x3.cc
mace/kernels/opencl/conv_2d_opencl_3x3.cc
+8
-6
mace/kernels/opencl/conv_2d_opencl_general.cc
mace/kernels/opencl/conv_2d_opencl_general.cc
+8
-6
mace/kernels/opencl/depthwise_conv_opencl_3x3.cc
mace/kernels/opencl/depthwise_conv_opencl_3x3.cc
+8
-6
mace/kernels/opencl/pooling_opencl.cc
mace/kernels/opencl/pooling_opencl.cc
+8
-6
mace/kernels/opencl/relu_opencl.cc
mace/kernels/opencl/relu_opencl.cc
+8
-6
mace/kernels/opencl/resize_bilinear_opencl.cc
mace/kernels/opencl/resize_bilinear_opencl.cc
+8
-6
mace/kernels/opencl/space_to_batch_opecl.cc
mace/kernels/opencl/space_to_batch_opecl.cc
+8
-6
tools/bazel-adb-run.sh
tools/bazel-adb-run.sh
+1
-1
未找到文件。
mace/kernels/opencl/addn.cc
浏览文件 @
bf8531f2
...
@@ -84,12 +84,14 @@ static void AddN(const std::vector<const Tensor *> &input_tensors,
...
@@ -84,12 +84,14 @@ static void AddN(const std::vector<const Tensor *> &input_tensors,
params_generator
,
params_generator
,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
mace/kernels/opencl/batch_norm_opencl.cc
浏览文件 @
bf8531f2
...
@@ -96,12 +96,14 @@ void BatchNormFunctor<DeviceType::OPENCL, T>::operator()(
...
@@ -96,12 +96,14 @@ void BatchNormFunctor<DeviceType::OPENCL, T>::operator()(
params_generator
,
params_generator
,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
template
...
...
mace/kernels/opencl/bias_add_opencl.cc
浏览文件 @
bf8531f2
...
@@ -50,12 +50,14 @@ void BiasAddFunctor<DeviceType::OPENCL, T>::operator()(
...
@@ -50,12 +50,14 @@ void BiasAddFunctor<DeviceType::OPENCL, T>::operator()(
cl
::
NDRange
(
lws
[
0
],
lws
[
1
],
lws
[
2
]),
cl
::
NDRange
(
lws
[
0
],
lws
[
1
],
lws
[
2
]),
nullptr
,
&
event
);
nullptr
,
&
event
);
MACE_CHECK
(
error
==
CL_SUCCESS
);
MACE_CHECK
(
error
==
CL_SUCCESS
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
template
...
...
mace/kernels/opencl/buffer_to_image.cc
浏览文件 @
bf8531f2
...
@@ -73,12 +73,14 @@ void BufferToImageFunctor<DeviceType::OPENCL, T>::operator()(Tensor *buffer,
...
@@ -73,12 +73,14 @@ void BufferToImageFunctor<DeviceType::OPENCL, T>::operator()(Tensor *buffer,
nullptr
,
&
event
);
nullptr
,
&
event
);
MACE_CHECK
(
error
==
CL_SUCCESS
)
<<
"Error code: "
<<
error
;
MACE_CHECK
(
error
==
CL_SUCCESS
)
<<
"Error code: "
<<
error
;
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
struct
BufferToImageFunctor
<
DeviceType
::
OPENCL
,
float
>;
template
struct
BufferToImageFunctor
<
DeviceType
::
OPENCL
,
float
>;
...
...
mace/kernels/opencl/concat.cc
浏览文件 @
bf8531f2
...
@@ -97,12 +97,14 @@ static void Concat2(const Tensor *input0,
...
@@ -97,12 +97,14 @@ static void Concat2(const Tensor *input0,
params_generator
,
params_generator
,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
mace/kernels/opencl/conv_2d_opencl_1x1.cc
浏览文件 @
bf8531f2
...
@@ -114,12 +114,14 @@ void Conv1x1(const Tensor *input,
...
@@ -114,12 +114,14 @@ void Conv1x1(const Tensor *input,
params_generator
,
params_generator
,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
extern
void
Conv2dOpenclK1x1S1
(
const
Tensor
*
input
,
extern
void
Conv2dOpenclK1x1S1
(
const
Tensor
*
input
,
...
...
mace/kernels/opencl/conv_2d_opencl_3x3.cc
浏览文件 @
bf8531f2
...
@@ -107,12 +107,14 @@ static void Conv2d3x3S12(const Tensor *input, const Tensor *filter,
...
@@ -107,12 +107,14 @@ static void Conv2d3x3S12(const Tensor *input, const Tensor *filter,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
void
Conv2dOpenclK3x3S1
(
const
Tensor
*
input
,
void
Conv2dOpenclK3x3S1
(
const
Tensor
*
input
,
const
Tensor
*
filter
,
const
Tensor
*
filter
,
...
...
mace/kernels/opencl/conv_2d_opencl_general.cc
浏览文件 @
bf8531f2
...
@@ -109,12 +109,14 @@ void Conv2dOpencl(const Tensor *input, const Tensor *filter,
...
@@ -109,12 +109,14 @@ void Conv2dOpencl(const Tensor *input, const Tensor *filter,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
}
// namespace kernels
}
// namespace kernels
...
...
mace/kernels/opencl/depthwise_conv_opencl_3x3.cc
浏览文件 @
bf8531f2
...
@@ -66,12 +66,14 @@ static void InnerDepthwiseConvOpenclK3x3S12(const Tensor *input,
...
@@ -66,12 +66,14 @@ static void InnerDepthwiseConvOpenclK3x3S12(const Tensor *input,
nullptr
,
&
event
);
nullptr
,
&
event
);
MACE_CHECK
(
error
==
CL_SUCCESS
);
MACE_CHECK
(
error
==
CL_SUCCESS
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
extern
void
DepthwiseConvOpenclK3x3S1
(
const
Tensor
*
input
,
extern
void
DepthwiseConvOpenclK3x3S1
(
const
Tensor
*
input
,
...
...
mace/kernels/opencl/pooling_opencl.cc
浏览文件 @
bf8531f2
...
@@ -110,12 +110,14 @@ static void Pooling(const Tensor *input,
...
@@ -110,12 +110,14 @@ static void Pooling(const Tensor *input,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
mace/kernels/opencl/relu_opencl.cc
浏览文件 @
bf8531f2
...
@@ -97,12 +97,14 @@ void ReluFunctor<DeviceType::OPENCL, T>::operator()(const Tensor *input,
...
@@ -97,12 +97,14 @@ void ReluFunctor<DeviceType::OPENCL, T>::operator()(const Tensor *input,
params_generator
,
params_generator
,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
template
...
...
mace/kernels/opencl/resize_bilinear_opencl.cc
浏览文件 @
bf8531f2
...
@@ -102,12 +102,14 @@ void ResizeBilinearFunctor<DeviceType::OPENCL, T>::operator()(
...
@@ -102,12 +102,14 @@ void ResizeBilinearFunctor<DeviceType::OPENCL, T>::operator()(
params_generator
,
params_generator
,
func
,
func
,
&
timer
);
&
timer
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
template
struct
ResizeBilinearFunctor
<
DeviceType
::
OPENCL
,
float
>;
template
struct
ResizeBilinearFunctor
<
DeviceType
::
OPENCL
,
float
>;
...
...
mace/kernels/opencl/space_to_batch_opecl.cc
浏览文件 @
bf8531f2
...
@@ -50,12 +50,14 @@ void SpaceToBatchFunctor<DeviceType::OPENCL, float>::operator()(Tensor *space_te
...
@@ -50,12 +50,14 @@ void SpaceToBatchFunctor<DeviceType::OPENCL, float>::operator()(Tensor *space_te
cl
::
NDRange
(
lws
[
0
],
lws
[
1
],
lws
[
2
]),
cl
::
NDRange
(
lws
[
0
],
lws
[
1
],
lws
[
2
]),
nullptr
,
&
event
);
nullptr
,
&
event
);
MACE_CHECK
(
error
==
CL_SUCCESS
);
MACE_CHECK
(
error
==
CL_SUCCESS
);
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
future
!=
nullptr
)
{
event
.
wait
();
future
->
wait_fn
=
[
runtime
,
event
](
CallStats
*
stats
)
{
if
(
stats
!=
nullptr
)
{
event
.
wait
();
runtime
->
GetCallStats
(
event
,
stats
);
if
(
stats
!=
nullptr
)
{
}
runtime
->
GetCallStats
(
event
,
stats
);
};
}
};
}
}
}
}
// namespace kernels
}
// namespace kernels
...
...
tools/bazel-adb-run.sh
浏览文件 @
bf8531f2
...
@@ -42,5 +42,5 @@ for device in `adb devices | grep "^[A-Za-z0-9]\+[[:space:]]\+device$"| cut -f1`
...
@@ -42,5 +42,5 @@ for device in `adb devices | grep "^[A-Za-z0-9]\+[[:space:]]\+device$"| cut -f1`
adb
-s
${
device
}
shell
"mkdir -p
$DEVICE_PATH
"
adb
-s
${
device
}
shell
"mkdir -p
$DEVICE_PATH
"
adb
-s
${
device
}
push
$CL_PATH
$DEVICE_CL_PATH
&&
\
adb
-s
${
device
}
push
$CL_PATH
$DEVICE_CL_PATH
&&
\
adb
-s
${
device
}
push
$BAZEL_BIN_PATH
/
$BIN_NAME
$DEVICE_PATH
&&
\
adb
-s
${
device
}
push
$BAZEL_BIN_PATH
/
$BIN_NAME
$DEVICE_PATH
&&
\
adb
-s
${
device
}
shell
"MACE_KERNEL_PATH=
$DEVICE_CL_PATH
MACE_CPP_MIN_VLOG_LEVEL=
0
$VLOG_LEVEL
$DEVICE_PATH
/
$BIN_NAME
$@
"
adb
-s
${
device
}
shell
"MACE_KERNEL_PATH=
$DEVICE_CL_PATH
MACE_CPP_MIN_VLOG_LEVEL=
$VLOG_LEVEL
$DEVICE_PATH
/
$BIN_NAME
$@
"
done
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录