Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
3cd728dc
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3cd728dc
编写于
4月 23, 2020
作者:
J
jiaopu
提交者:
MaxwellDing
4月 23, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix error caused by merge upstream
上级
c2173f91
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
4 addition
and
73 deletion
+4
-73
lite/core/context.h
lite/core/context.h
+4
-2
lite/core/device_info.cc
lite/core/device_info.cc
+0
-48
lite/core/device_info.h
lite/core/device_info.h
+0
-23
未找到文件。
lite/core/context.h
浏览文件 @
3cd728dc
...
...
@@ -271,10 +271,12 @@ class Context<TargetType::kMLU> {
void
SetIoQueue
(
cnrtQueue_t
queue
)
{
io_queue_
=
queue
;
}
cnmlCoreVersion_t
MLUCoreVersion
()
{
return
DeviceInfo
::
Global
().
MLUCoreVersion
();
return
paddle
::
lite
::
TargetWrapperMlu
::
MLUCoreVersion
();
}
int
MLUCoreNumber
()
{
return
DeviceInfo
::
Global
().
MLUCoreNumber
();
}
int
MLUCoreNumber
()
{
return
paddle
::
lite
::
TargetWrapperMlu
::
MLUCoreNumber
();
}
u32_t
affinity
()
{
return
affinity_
;
}
...
...
lite/core/device_info.cc
浏览文件 @
3cd728dc
...
...
@@ -66,15 +66,6 @@ thread_local std::vector<int> DeviceInfo::active_ids_;
thread_local
TensorLite
DeviceInfo
::
workspace_
;
thread_local
int64_t
DeviceInfo
::
count_
=
0
;
#ifdef LITE_WITH_MLU
thread_local
cnmlCoreVersion_t
DeviceInfo
::
mlu_core_version_
{
CNML_MLU270
};
thread_local
int
DeviceInfo
::
mlu_core_number_
{
1
};
thread_local
bool
DeviceInfo
::
use_first_conv_
{
false
};
thread_local
std
::
vector
<
float
>
DeviceInfo
::
mean_vec_
;
thread_local
std
::
vector
<
float
>
DeviceInfo
::
std_vec_
;
thread_local
DataLayoutType
DeviceInfo
::
input_layout_
{
DATALAYOUT
(
kNCHW
)};
#endif
#ifdef TARGET_IOS
const
int
DEFAULT_L1_CACHE_SIZE
=
64
*
1024
;
const
int
DEFAULT_L2_CACHE_SIZE
=
2048
*
1024
;
...
...
@@ -1089,45 +1080,6 @@ int DeviceInfo::Setup() {
return
0
;
}
#ifdef LITE_WITH_MLU
void
DeviceInfo
::
SetMLURunMode
(
lite_api
::
MLUCoreVersion
core_version
,
int
core_number
,
bool
use_first_conv
,
const
std
::
vector
<
float
>&
mean_vec
,
const
std
::
vector
<
float
>&
std_vec
,
DataLayoutType
input_layout
)
{
switch
(
core_version
)
{
case
(
lite_api
::
MLUCoreVersion
::
MLU_220
):
mlu_core_version_
=
CNML_MLU220
;
break
;
case
(
lite_api
::
MLUCoreVersion
::
MLU_270
):
mlu_core_version_
=
CNML_MLU270
;
break
;
default:
mlu_core_version_
=
CNML_MLU270
;
break
;
}
mlu_core_number_
=
core_number
;
use_first_conv_
=
use_first_conv
;
mean_vec_
=
mean_vec
;
std_vec_
=
std_vec
;
input_layout_
=
input_layout
;
}
cnmlCoreVersion_t
DeviceInfo
::
MLUCoreVersion
()
{
return
mlu_core_version_
;
}
int
DeviceInfo
::
MLUCoreNumber
()
{
return
mlu_core_number_
;
}
bool
DeviceInfo
::
UseFirstConv
()
{
return
use_first_conv_
;
}
const
std
::
vector
<
float
>&
DeviceInfo
::
MeanVec
()
const
{
return
mean_vec_
;
}
const
std
::
vector
<
float
>&
DeviceInfo
::
StdVec
()
const
{
return
std_vec_
;
}
DataLayoutType
DeviceInfo
::
InputLayout
()
const
{
return
input_layout_
;
}
#endif // LITE_WITH_MLU
void
DeviceInfo
::
SetRunMode
(
lite_api
::
PowerMode
mode
,
int
thread_num
)
{
#ifdef ARM_WITH_OMP
thread_num
=
std
::
min
(
thread_num
,
core_num_
);
...
...
lite/core/device_info.h
浏览文件 @
3cd728dc
...
...
@@ -55,20 +55,6 @@ class DeviceInfo {
int
Setup
();
void
SetRunMode
(
lite_api
::
PowerMode
mode
,
int
thread_num
);
#ifdef LITE_WITH_MLU
void
SetMLURunMode
(
lite_api
::
MLUCoreVersion
core_version
,
int
core_number
,
bool
use_first_conv
,
const
std
::
vector
<
float
>&
mean_vec
,
const
std
::
vector
<
float
>&
std_vec
,
DataLayoutType
input_layout
);
cnmlCoreVersion_t
MLUCoreVersion
();
int
MLUCoreNumber
();
bool
UseFirstConv
();
const
std
::
vector
<
float
>&
MeanVec
()
const
;
const
std
::
vector
<
float
>&
StdVec
()
const
;
DataLayoutType
InputLayout
()
const
;
#endif
void
SetCache
(
int
l1size
,
int
l2size
,
int
l3size
);
void
SetArch
(
ARMArch
arch
)
{
arch_
=
arch
;
}
...
...
@@ -120,15 +106,6 @@ class DeviceInfo {
static
thread_local
TensorLite
workspace_
;
static
thread_local
int64_t
count_
;
#ifdef LITE_WITH_MLU
static
thread_local
cnmlCoreVersion_t
mlu_core_version_
;
static
thread_local
int
mlu_core_number_
;
static
thread_local
bool
use_first_conv_
;
static
thread_local
std
::
vector
<
float
>
mean_vec_
;
static
thread_local
std
::
vector
<
float
>
std_vec_
;
static
thread_local
DataLayoutType
input_layout_
;
#endif
void
SetDotInfo
(
int
argc
,
...);
void
SetFP16Info
(
int
argc
,
...);
void
SetFP32Info
(
int
argc
,
...);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录