Browse Source

fix clang

pull/1312/head
wangxiaotian22 4 years ago
parent
commit
7fad65a58e
2 changed files with 25 additions and 19 deletions
  1. +6
    -0
      ge/graph/build/stream_graph_optimizer.cc
  2. +19
    -19
      inc/framework/common/debug/log.h

+ 6
- 0
ge/graph/build/stream_graph_optimizer.cc View File

@@ -122,6 +122,9 @@ Status StreamGraphOptimizer::OptimizeStreamedSubGraph(const ComputeGraphPtr &com
GE_CHECK_NOTNULL(op_desc);
int64_t stream_id = op_desc->GetStreamId();
if (static_cast<size_t>(stream_id) >= run_context.graphStreamList.size()) {
REPORT_INNER_ERROR("Check stream_id:%ld in op:%s(%s) is bigger than run_context.graphStreamList.size():%zu "
"when %s", stream_id, op_desc->GetName().c_str(),
op_desc->GetType().c_str(), run_context.graphStreamList.size(), __FUNCTION__);
GELOGE(FAILED, "stream_id %ld is bigger than run_context.graphStreamList.size() %zu", stream_id,
run_context.graphStreamList.size());
return FAILED;
@@ -135,6 +138,9 @@ Status StreamGraphOptimizer::OptimizeStreamedSubGraph(const ComputeGraphPtr &com
for (auto iter = graph_optimizers.begin(); iter != graph_optimizers.end(); ++iter) {
GE_CHECK_NOTNULL(*iter);
Status ret = (*iter)->OptimizeStreamGraph(*subgraph, run_context);
REPORT_CALL_ERROR("Call optimize streamed subgraph failed, subgraph: %s, engine_name: %s, graph "
"Optimizer num: %zu, ret: %u", subgraph->GetName().c_str(), engine_name.c_str(),
graph_optimizers.size(), ret);
if (ret != SUCCESS) {
GELOGE(
ret,


+ 19
- 19
inc/framework/common/debug/log.h View File

@@ -58,22 +58,22 @@
}

// If expr is not SUCCESS, print the log and return the same value
#define GE_CHK_STATUS_RET(expr, ...) \
do { \
const ge::Status _status = (expr); \
if (_status != ge::SUCCESS) { \
DOMI_LOGE(__VA_ARGS__); \
return _status; \
} \
#define GE_CHK_STATUS_RET(expr, ...) \
do { \
const ge::Status _status = (expr); \
if (_status != ge::SUCCESS) { \
DOMI_LOGE(__VA_ARGS__); \
return _status; \
} \
} while (0);

// If expr is not SUCCESS, print the log and do not execute return
#define GE_CHK_STATUS(expr, ...) \
do { \
const ge::Status _status = (expr); \
if (_status != ge::SUCCESS) { \
DOMI_LOGE(__VA_ARGS__); \
} \
#define GE_CHK_STATUS(expr, ...) \
do { \
const ge::Status _status = (expr); \
if (_status != ge::SUCCESS) { \
DOMI_LOGE(__VA_ARGS__); \
} \
} while (0);

// If expr is not SUCCESS, return the same value
@@ -86,12 +86,12 @@
} while (0);

// If expr is not GRAPH_SUCCESS, print the log and return FAILED
#define GE_CHK_GRAPH_STATUS_RET(expr, ...) \
do { \
if ((expr) != ge::GRAPH_SUCCESS) { \
DOMI_LOGE(__VA_ARGS__); \
return FAILED; \
} \
#define GE_CHK_GRAPH_STATUS_RET(expr, ...) \
do { \
if ((expr) != ge::GRAPH_SUCCESS) { \
DOMI_LOGE(__VA_ARGS__); \
return FAILED; \
} \
} while (0);

// If expr is not SUCCESS, print the log and execute a custom statement


Loading…
Cancel
Save