Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
5d9dbb02
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,发现更多精彩内容 >>
提交
5d9dbb02
编写于
7月 09, 2018
作者:
李
李寅
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor mace-nnlib
上级
6bec216a
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
8 addition
and
51 deletion
+8
-51
mace/core/mace.cc
mace/core/mace.cc
+0
-3
mace/core/runtime/hexagon/hexagon_control_wrapper.cc
mace/core/runtime/hexagon/hexagon_control_wrapper.cc
+2
-7
mace/core/runtime/hexagon/hexagon_control_wrapper.h
mace/core/runtime/hexagon/hexagon_control_wrapper.h
+1
-2
mace/core/runtime/hexagon/hexagon_controller.h
mace/core/runtime/hexagon/hexagon_controller.h
+0
-36
third_party/nnlib/hexagon_nn.h
third_party/nnlib/hexagon_nn.h
+5
-3
third_party/nnlib/libhexagon_controller.so
third_party/nnlib/libhexagon_controller.so
+0
-0
未找到文件。
mace/core/mace.cc
浏览文件 @
5d9dbb02
...
...
@@ -204,9 +204,6 @@ MaceStatus MaceEngine::Impl::Init(
MACE_CHECK
(
hexagon_controller_
->
Init
(),
"hexagon init error"
);
hexagon_controller_
->
SetDebugLevel
(
static_cast
<
int
>
(
mace
::
logging
::
LogMessage
::
MinVLogLevel
()));
int
dsp_mode
=
ProtoArgHelper
::
GetOptionalArg
<
NetDef
,
int
>
(
*
net_def
,
"dsp_mode"
,
0
);
hexagon_controller_
->
SetGraphMode
(
dsp_mode
);
MACE_CHECK
(
hexagon_controller_
->
SetupGraph
(
*
net_def
,
model_data
),
"hexagon setup graph error"
);
if
(
VLOG_IS_ON
(
2
))
{
...
...
mace/core/runtime/hexagon/hexagon_control_wrapper.cc
浏览文件 @
5d9dbb02
...
...
@@ -51,7 +51,7 @@ int HexagonControlWrapper::GetVersion() {
bool
HexagonControlWrapper
::
Config
()
{
LOG
(
INFO
)
<<
"Hexagon config"
;
if
(
hexagon_
controller_InitHexagonWithMaxAttributes
(
0
,
10
0
)
!=
0
)
{
if
(
hexagon_
nn_set_powersave_level
(
0
)
!=
0
)
{
return
false
;
}
return
hexagon_nn_config
()
==
0
;
...
...
@@ -66,7 +66,7 @@ bool HexagonControlWrapper::Init() {
bool
HexagonControlWrapper
::
Finalize
()
{
LOG
(
INFO
)
<<
"Hexagon finalize"
;
return
hexagon_
controller_DeInitHexagon
(
)
==
0
;
return
hexagon_
nn_set_powersave_level
(
1
)
==
0
;
}
bool
HexagonControlWrapper
::
SetupGraph
(
const
NetDef
&
net_def
,
...
...
@@ -271,11 +271,6 @@ void HexagonControlWrapper::SetDebugLevel(int level) {
"set debug level error"
);
}
void
HexagonControlWrapper
::
SetGraphMode
(
int
mode
)
{
LOG
(
INFO
)
<<
"Set dsp mode: "
<<
mode
;
MACE_CHECK
(
hexagon_nn_set_graph_mode
(
nn_id_
,
mode
)
==
0
,
"set mode error"
);
}
void
HexagonControlWrapper
::
GetPerfInfo
()
{
LOG
(
INFO
)
<<
"Get perf info"
;
std
::
vector
<
hexagon_nn_perfinfo
>
perf_info
(
MACE_MAX_NODE
);
...
...
mace/core/runtime/hexagon/hexagon_control_wrapper.h
浏览文件 @
5d9dbb02
...
...
@@ -17,10 +17,10 @@
#include <vector>
#include "mace/core/runtime/hexagon/hexagon_controller.h"
#include "mace/core/runtime/hexagon/quantize.h"
#include "mace/core/tensor.h"
#include "mace/public/mace.h"
#include "third_party/nnlib/hexagon_nn.h"
namespace
mace
{
...
...
@@ -44,7 +44,6 @@ class HexagonControlWrapper {
void
GetPerfInfo
();
void
ResetPerfInfo
();
void
SetDebugLevel
(
int
level
);
void
SetGraphMode
(
int
mode
);
private:
static
constexpr
int
NODE_ID_OFFSET
=
10000
;
...
...
mace/core/runtime/hexagon/hexagon_controller.h
已删除
100644 → 0
浏览文件 @
6bec216a
// Copyright 2018 Xiaomi, Inc. 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.
#ifndef MACE_CORE_RUNTIME_HEXAGON_HEXAGON_CONTROLLER_H_
#define MACE_CORE_RUNTIME_HEXAGON_HEXAGON_CONTROLLER_H_
#include "third_party/nnlib/hexagon_nn.h"
#ifdef __cplusplus
extern
"C"
{
#else
#include <stdbool.h>
#endif // __cplusplus
int
hexagon_controller_InitHexagonWithMaxAttributes
(
int
enable_dcvs
,
int
bus_usage
);
int
hexagon_controller_DeInitHexagon
();
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // MACE_CORE_RUNTIME_HEXAGON_HEXAGON_CONTROLLER_H_
third_party/nnlib/hexagon_nn.h
浏览文件 @
5d9dbb02
...
...
@@ -37,7 +37,7 @@
#define THIRD_PARTY_NNLIB_HEXAGON_NN_H_
#ifndef __QAIC_HEADER
#define __QAIC_HEADER(ff) ff
#endif //
__QAIC_HEADER
#endif //__QAIC_HEADER
#ifndef __QAIC_HEADER_EXPORT
#define __QAIC_HEADER_EXPORT
...
...
@@ -49,7 +49,7 @@
#ifndef __QAIC_IMPL
#define __QAIC_IMPL(ff) ff
#endif //
__QAIC_IMPL
#endif //__QAIC_IMPL
#ifndef __QAIC_IMPL_EXPORT
#define __QAIC_IMPL_EXPORT
...
...
@@ -131,7 +131,7 @@ struct hexagon_nn_const_node {
};
__QAIC_HEADER_EXPORT
int
__QAIC_HEADER
(
hexagon_nn_config
)(
void
)
__QAIC_HEADER_ATTRIBUTE
;
__QAIC_HEADER_EXPORT
int
__QAIC_HEADER
(
hexagon_nn_init
)(
hexagon_nn_nn_id
*
g
)
__QAIC_HEADER_EXPORT
int
__QAIC_HEADER
(
hexagon_nn_init
)(
hexagon_nn_nn_id
*
g
)
__QAIC_HEADER_ATTRIBUTE
;
__QAIC_HEADER_EXPORT
int
__QAIC_HEADER
(
hexagon_nn_set_debug_level
)(
hexagon_nn_nn_id
id
,
int
level
)
__QAIC_HEADER_ATTRIBUTE
;
...
...
@@ -221,6 +221,8 @@ __QAIC_HEADER_EXPORT int __QAIC_HEADER(hexagon_nn_execute_new)(
int
inputsLen
,
hexagon_nn_tensordef
*
outputs
,
int
outputsLen
)
__QAIC_HEADER_ATTRIBUTE
;
__QAIC_HEADER_EXPORT
unsigned
int
__QAIC_HEADER
(
hexagon_nn_get_dsp_offset
)(
void
)
__QAIC_HEADER_ATTRIBUTE
;
#ifdef __cplusplus
}
#endif
...
...
third_party/nnlib/libhexagon_controller.so
浏览文件 @
5d9dbb02
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录