Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
06aa998e
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看板
提交
06aa998e
编写于
4月 15, 2020
作者:
J
jackzhang235
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge error fix
上级
c5b969dc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
30 deletion
+48
-30
lite/api/paddle_lite_factory_helper.h
lite/api/paddle_lite_factory_helper.h
+44
-1
lite/core/mir/mlu_postprocess_pass.cc
lite/core/mir/mlu_postprocess_pass.cc
+2
-2
lite/kernels/mlu/bridges/graph.h
lite/kernels/mlu/bridges/graph.h
+2
-1
lite/kernels/mlu/subgraph_compute.h
lite/kernels/mlu/subgraph_compute.h
+0
-26
未找到文件。
lite/api/paddle_lite_factory_helper.h
浏览文件 @
06aa998e
...
...
@@ -19,7 +19,50 @@
#pragma once
// some platform-independent defintion
#include "lite/utils/macros.h"
// #include "lite/utils/macros.h"
// just copy lite/utils/macros.h here temperarily by mlu, since it affects
// compilation of demos
// BEGIN by MLU
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(class__) \
class__(const class__&) = delete; \
class__& operator=(const class__&) = delete;
#endif
#define LITE_UNIMPLEMENTED CHECK(false) << "Not Implemented";
#if defined(_WIN32)
#define UNUSED
#define __builtin_expect(EXP, C) (EXP)
#else
#define UNUSED __attribute__((unused))
#endif
/*
#ifndef LIKELY
#define LIKELY(x) __builtin_expect(!!(x), 1)
#endif
#ifndef UNLIKELY
//#define UNLIKELY(x) __built_expect(!!(x), 0)
#define UNLIKELY(x) (x)
#endif
*/
#ifdef __CUDACC__
#define HOSTDEVICE __host__ __device__
#define DEVICE __device__
#define HOST __host__
#else
#define HOSTDEVICE
#define DEVICE
#define HOST
#endif
#if defined(__FLT_MAX__)
#define FLT_MAX __FLT_MAX__
#endif // __FLT_MAX__
// END by MLU
#define USE_LITE_OP(op_type__) \
extern int touch_op_##op_type__(); \
...
...
lite/core/mir/mlu_postprocess_pass.cc
浏览文件 @
06aa998e
...
...
@@ -570,11 +570,11 @@ void MLUPostprocessPass::Apply(const std::unique_ptr<SSAGraph>& graph) {
// arg_in and arg_out are assumed to be NHWC which user should be aware of.
// Thus here we change these args' layout to NHWC
#ifdef LITE_WITH_MLU
if
(
lite
::
DeviceInfo
::
Global
().
InputLayout
()
==
DATALAYOUT
(
kNHWC
))
{
if
(
lite
::
TargetWrapperMlu
::
InputLayout
()
==
DATALAYOUT
(
kNHWC
))
{
ModifyLayout
(
graph
.
get
());
}
if
(
lite
::
DeviceInfo
::
Global
().
UseFirstConv
())
{
if
(
lite
::
TargetWrapperMlu
::
UseFirstConv
())
{
GatherAndModifyFirstConvNodes
(
graph
.
get
());
}
#endif
...
...
lite/kernels/mlu/bridges/graph.h
浏览文件 @
06aa998e
...
...
@@ -120,7 +120,8 @@ class Graph {
output_addrs_
[
i
]
=
output_tensors_
[
i
]
->
mlu_data
();
}
#if PRINT_HW_TIME thread_local float hw_time;
#if PRINT_HW_TIME
thread_local
float
hw_time
;
CNRT_CALL
(
cnrtPlaceNotifier
(
notifier_start_
,
que
));
#endif
CNML_CALL
(
cnmlComputeFusionOpForward_V3
(
fusion_op_
,
...
...
lite/kernels/mlu/subgraph_compute.h
浏览文件 @
06aa998e
...
...
@@ -84,32 +84,6 @@ class SubgraphEngine : public subgraph::Engine {
return
true
;
}
int
Build
()
{
// In order to attach all of the ops of the block desc, we need to build
// the original program firstly.
BuildOriginProgram
();
// Run InferShape() of all of ops, and convert Paddle ops to MLU IR graph
build_device_program_status_
=
BuildDeviceProgram
();
return
build_device_program_status_
;
}
int
Launch
()
{
// Rebuild device program when the shapes of input tensors have been
// changed.
if
(
subgraph
::
CHECK_SUCCESS
(
build_device_program_status_
)
&&
subgraph
::
CHECK_REBUILD_WHEN_SHAPE_CHANGED
(
build_device_program_status_
)
&&
InputShapeChanged
())
{
Build
();
}
if
(
subgraph
::
CHECK_FAILED
(
build_device_program_status_
))
{
LaunchOriginProgram
();
}
else
{
LaunchDeviceProgram
();
}
return
0
;
}
protected:
int
BuildDeviceProgram
()
override
{
int
status
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录