From b5c16b8f03d78bfaff207f98c02645540eba0b25 Mon Sep 17 00:00:00 2001 From: jackzhang235 Date: Tue, 12 May 2020 12:23:04 +0000 Subject: [PATCH] add CNML_CALL for cnmlxxx --- lite/kernels/mlu/bridges/graph.h | 4 ++-- lite/kernels/mlu/subgraph_compute.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lite/kernels/mlu/bridges/graph.h b/lite/kernels/mlu/bridges/graph.h index 6cf4067539..b927883b6f 100644 --- a/lite/kernels/mlu/bridges/graph.h +++ b/lite/kernels/mlu/bridges/graph.h @@ -110,8 +110,8 @@ class Graph { if (!disable_batch_size_changeable) { constexpr int input_dimNb = 4; bool input_dim_mutable[4] = {true, false, false, false}; - cnmlSetTensorDimMutable( - tensor->mlu_tensor(), input_dim_mutable, input_dimNb); + CNML_CALL(cnmlSetTensorDimMutable( + tensor->mlu_tensor(), input_dim_mutable, input_dimNb)); } } diff --git a/lite/kernels/mlu/subgraph_compute.h b/lite/kernels/mlu/subgraph_compute.h index 72ab7cd270..5d696a7402 100644 --- a/lite/kernels/mlu/subgraph_compute.h +++ b/lite/kernels/mlu/subgraph_compute.h @@ -179,6 +179,8 @@ class SubgraphEngine : public subgraph::Engine { auto op = inst.op(); CHECK(op); std::string op_type = op->op_info()->Type(); + // since cnml's compile api will not return error now, we simply check + // op's type if (!disable_batch_size_changeable_ && std::find(unsupport_batch_size_changeable_op_type_.begin(), unsupport_batch_size_changeable_op_type_.end(), -- GitLab