Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
c796c29b
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,发现更多精彩内容 >>
提交
c796c29b
编写于
7月 05, 2018
作者:
Y
yejianwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix protobuf version conflict with os (remove unnecessary symbols)
上级
82ff5515
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
8 deletion
+20
-8
mace/mace_version_script.lds
mace/mace_version_script.lds
+7
-5
mace/public/mace.h
mace/public/mace.h
+3
-2
mace/public/mace_runtime.h
mace/public/mace_runtime.h
+8
-1
mace/tools/git/gen_version_source.sh
mace/tools/git/gen_version_source.sh
+1
-0
tools/bazel.rc
tools/bazel.rc
+1
-0
未找到文件。
mace/mace_version_script.lds
浏览文件 @
c796c29b
...
...
@@ -2,13 +2,15 @@ mace {
global:
*MaceTensor*;
*MaceEngine*;
*MaceVersion*;
*SetOpenMPThreadPolicy*;
*SetGPUHints*;
*SetOpenCLBinaryPaths*;
*CreateMaceEngineFromProto*;
*FileStorageFactory*;
*SetKVStorageFactory*;
*CreateMaceEngineFromProto*;
*SetOpenCLBinaryPaths*;
*SetGPUHints*;
*SetOpenMPThreadPolicy*;
*SetOpenMPThreadAffinity*;
*GetBigLittleCoreIDs*;
*MaceVersion*;
local:
*;
};
mace/public/mace.h
浏览文件 @
c796c29b
...
...
@@ -74,7 +74,7 @@ enum MaceStatus {
}
// MACE input/output tensor
class
MaceTensor
{
class
__attribute__
((
visibility
(
"default"
)))
MaceTensor
{
public:
// shape - the shape of the tensor, with size n
// data - the buffer of the tensor, must not be null with size equals
...
...
@@ -97,7 +97,7 @@ class MaceTensor {
std
::
unique_ptr
<
Impl
>
impl_
;
};
class
MaceEngine
{
class
__attribute__
((
visibility
(
"default"
)))
MaceEngine
{
public:
explicit
MaceEngine
(
DeviceType
device_type
);
~
MaceEngine
();
...
...
@@ -127,6 +127,7 @@ class MaceEngine {
MaceEngine
&
operator
=
(
const
MaceEngine
&
)
=
delete
;
};
__attribute__
((
visibility
(
"default"
)))
MaceStatus
CreateMaceEngineFromProto
(
const
std
::
vector
<
unsigned
char
>
&
model_pb
,
const
std
::
string
&
model_data_file
,
...
...
mace/public/mace_runtime.h
浏览文件 @
c796c29b
...
...
@@ -63,7 +63,8 @@ class KVStorageFactory {
virtual
std
::
unique_ptr
<
KVStorage
>
CreateStorage
(
const
std
::
string
&
name
)
=
0
;
};
class
FileStorageFactory
:
public
KVStorageFactory
{
class
__attribute__
((
visibility
(
"default"
)))
FileStorageFactory
:
public
KVStorageFactory
{
public:
explicit
FileStorageFactory
(
const
std
::
string
&
path
);
...
...
@@ -77,6 +78,7 @@ class FileStorageFactory : public KVStorageFactory {
};
// Set KV store factory used as OpenCL cache. (Call Once)
__attribute__
((
visibility
(
"default"
)))
void
SetKVStorageFactory
(
std
::
shared_ptr
<
KVStorageFactory
>
storage_factory
);
// Just call once. (Not thread-safe)
...
...
@@ -85,11 +87,13 @@ void SetKVStorageFactory(std::shared_ptr<KVStorageFactory> storage_factory);
// Using OpenCL binary will speed up the initialization.
// OpenCL binary is corresponding to the OpenCL Driver version,
// you should update the binary when OpenCL Driver changed.
__attribute__
((
visibility
(
"default"
)))
void
SetOpenCLBinaryPaths
(
const
std
::
vector
<
std
::
string
>
&
paths
);
// Set GPU hints, currently only supports Adreno GPU.
//
// Caution: this function may hurt performance if improper parameters provided.
__attribute__
((
visibility
(
"default"
)))
void
SetGPUHints
(
GPUPerfHint
perf_hint
,
GPUPriorityHint
priority_hint
);
// Set OpenMP threads number and affinity policy.
...
...
@@ -109,6 +113,7 @@ void SetGPUHints(GPUPerfHint perf_hint, GPUPriorityHint priority_hint);
// If successful, it returns MACE_SUCCESS and error if it can't reliabley
// detect big-LITTLE cores (see GetBigLittleCoreIDs). In such cases, it's
// suggested to use AFFINITY_NONE to use all cores.
__attribute__
((
visibility
(
"default"
)))
MaceStatus
SetOpenMPThreadPolicy
(
int
num_threads_hint
,
CPUAffinityPolicy
policy
);
...
...
@@ -119,6 +124,7 @@ MaceStatus SetOpenMPThreadPolicy(int num_threads_hint,
// This function may not work well on some chips (e.g. MTK). Setting thread
// affinity to offline cores may run very slow or unexpectedly. In such cases,
// please use SetOpenMPThreadPolicy with default policy instead.
__attribute__
((
visibility
(
"default"
)))
void
SetOpenMPThreadAffinity
(
int
num_threads
,
const
std
::
vector
<
int
>
&
cpu_ids
);
// Get ARM big.LITTLE configuration.
...
...
@@ -130,6 +136,7 @@ void SetOpenMPThreadAffinity(int num_threads, const std::vector<int> &cpu_ids);
//
// If successful, it returns MACE_SUCCESS and error if it can't reliabley
// detect the frequency of big-LITTLE cores (e.g. MTK).
__attribute__
((
visibility
(
"default"
)))
MaceStatus
GetBigLittleCoreIDs
(
std
::
vector
<
int
>
*
big_core_ids
,
std
::
vector
<
int
>
*
little_core_ids
);
...
...
mace/tools/git/gen_version_source.sh
浏览文件 @
c796c29b
...
...
@@ -45,6 +45,7 @@ cat <<EOF > ${OUTPUT_FILENAME}
// This is a generated file. DO NOT EDIT!
namespace mace {
__attribute__((visibility ("default")))
const char *MaceVersion() { return "MACEVER-
${
GIT_VERSION
}
" + 8; }
} // namespace mace
EOF
tools/bazel.rc
浏览文件 @
c796c29b
...
...
@@ -22,6 +22,7 @@ build:optimization --linkopt=-Wl,--strip-all
build:optimization --copt=-ffunction-sections
build:optimization --copt=-fdata-sections
build:optimization --linkopt=-Wl,--gc-sections
build:optimization --copt=-fvisibility=hidden
# Address sanitizer
build:asan --strip=never
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录