Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
7a450e87
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
338
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看板
提交
7a450e87
编写于
9月 22, 2020
作者:
J
Jiansong Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove the imagination nna sdk root from code, assume hwconf and
mapconf files located at directory where to run the program.
上级
a1c58f52
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
6 deletion
+29
-6
lite/backends/imagination_nna/imgdnn_manager.cc
lite/backends/imagination_nna/imgdnn_manager.cc
+24
-6
lite/backends/imagination_nna/imgdnn_manager.h
lite/backends/imagination_nna/imgdnn_manager.h
+5
-0
未找到文件。
lite/backends/imagination_nna/imgdnn_manager.cc
浏览文件 @
7a450e87
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
// limitations under the License.
// limitations under the License.
#include "imgdnn_manager.h" // NOLINT
#include "imgdnn_manager.h" // NOLINT
#include <unistd.h>
#include <utility>
#include <utility>
#include "ImgdnnManagerConfig.h"
#include "ImgdnnManagerConfig.h"
...
@@ -83,6 +84,22 @@ imgdnn_tensor ImgdnnManager::convertQuantTensorType(
...
@@ -83,6 +84,22 @@ imgdnn_tensor ImgdnnManager::convertQuantTensorType(
return
converted_tensor
;
return
converted_tensor
;
}
}
bool
ImgdnnManager
::
testConfigFileExists
(
const
std
::
string
&
hwconfig
,
const
std
::
string
&
mapconfig
)
{
if
(
access
(
hwconfig
.
c_str
(),
F_OK
)
==
-
1
)
goto
testConfigFileExistsError
;
if
(
access
(
mapconfig
.
c_str
(),
F_OK
)
==
-
1
)
goto
testConfigFileExistsError
;
return
true
;
testConfigFileExistsError:
char
*
pwd
=
getcwd
(
NULL
,
0
);
std
::
string
err_msg
{
"Could not find Imagination NNA config files: "
};
std
::
cerr
<<
err_msg
<<
hwconfig
<<
","
<<
mapconfig
<<
std
::
endl
;
std
::
cerr
<<
"Please place config files at: "
<<
pwd
<<
std
::
endl
;
free
(
pwd
);
exit
(
EXIT_FAILURE
);
}
imgdnn_tensor
ImgdnnManager
::
createConvolutionLayer
(
imgdnn_tensor
ImgdnnManager
::
createConvolutionLayer
(
imgdnn_tensor
input_tensor
,
imgdnn_tensor
input_tensor
,
imgdnn_tensor
weights_tensor
,
imgdnn_tensor
weights_tensor
,
...
@@ -321,14 +338,15 @@ imgdnn_network_object ImgdnnManager::createNetworkObject(
...
@@ -321,14 +338,15 @@ imgdnn_network_object ImgdnnManager::createNetworkObject(
imgdnn_tensor
*
outputs
)
{
imgdnn_tensor
*
outputs
)
{
const
imgdnn_network_object_flags
flags
=
0
;
const
imgdnn_network_object_flags
flags
=
0
;
// Add " --dump_debug_binaries enabled" to options_str if need debug info.
const
std
::
string
hwconfig
=
"config/mirage_hw_config06_23_2_6500_301.json"
;
std
::
string
options_str
;
const
std
::
string
mapconfig
=
"config/mapconfig_q8a.json"
;
std
::
string
ddk_root
{
IMAGINATION_NNA_SDK_ROOT
};
std
::
string
hwconfig
=
testConfigFileExists
(
hwconfig
,
mapconfig
)
ddk_root
+
"nna-tools/config/mirage_hw_config06_23_2_6500_301.json"
;
std
::
string
mapconfig
=
ddk_root
+
"nna-tools/config/mapconfig_q8a.json"
;
std
::
string
options_str
;
options_str
+=
"-h "
+
hwconfig
;
options_str
+=
"-h "
+
hwconfig
;
options_str
+=
" -m "
+
mapconfig
;
options_str
+=
" -m "
+
mapconfig
;
// Add " --dump_debug_binaries enabled" to options_str if need debug info.
net_obj_
=
imgdnnCreateNetworkObject
(
device_
,
net_obj_
=
imgdnnCreateNetworkObject
(
device_
,
context_
,
context_
,
...
...
lite/backends/imagination_nna/imgdnn_manager.h
浏览文件 @
7a450e87
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#pragma once
#pragma once
#include <unistd.h>
#include <cmath>
#include <cmath>
#include <memory>
#include <memory>
#include <string>
#include <string>
...
@@ -56,6 +57,10 @@ class ImgdnnManager {
...
@@ -56,6 +57,10 @@ class ImgdnnManager {
imgdnn_tensor
convertQuantTensorType
(
imgdnn_tensor
a_tensor
,
imgdnn_tensor
convertQuantTensorType
(
imgdnn_tensor
a_tensor
,
imgdnn_quant_param
*
dst_quant_param
);
imgdnn_quant_param
*
dst_quant_param
);
bool
testConfigFileExists
(
const
std
::
string
&
hwconfig
,
const
std
::
string
&
mapconfig
);
{
return
(
access
(
name
.
c_str
(),
F_OK
)
!=
-
1
);
}
public:
public:
ImgdnnManager
();
ImgdnnManager
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录