提交 06aa998e 编写于 作者: J jackzhang235

merge error fix

上级 c5b969dc
......@@ -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__(); \
......
......@@ -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
......
......@@ -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_,
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册