diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/base_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/base_op_builder.cc index f1137d94d7..5b5ff0f287 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/base_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/base_op_builder.cc @@ -54,7 +54,7 @@ Status BaseOpBuilder::AddToModelBuilder(ModelBuilder& model_builder, const NodeU ORT_RETURN_IF_NOT(IsOpSupported(model_builder.GetInitializerTensors(), node_unit, params), "Unsupported operator ", node_unit.OpType()); #ifndef NDEBUG - model_builder.SetDebugTrackNode(node_unit.Index()); + model_builder.SetDebugCurrentOnnxNodeIndex(node_unit.Index()); #endif ORT_RETURN_IF_ERROR(AddToModelBuilderImpl(model_builder, node_unit)); LOGS_DEFAULT(VERBOSE) << "Operator name: [" << node_unit.Name() diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.cc index 98eab1642a..522265ed85 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.cc @@ -479,7 +479,7 @@ Status ModelBuilder::AddOperation(int op, const InlinedVector& input_i const std::vector& output_names, const std::vector& output_types) { #ifndef NDEBUG - operations_recorder_.emplace_back(track_node_index_, op); + operations_recorder_.emplace_back(current_onnx_node_index_, op); #endif InlinedVector output_indices; for (size_t i = 0; i < output_types.size(); i++) { diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h index 25f16365da..e113e71564 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h @@ -111,8 +111,8 @@ class ModelBuilder { // ONNX node and NNAPI node are not a 1:1 mapping, like batch-normalization. // We use this to track a specific ONNX node which we are processing and record the detail mapping relationship. // So we can log out each NNAPI OP status during model-building and compiling. - void SetDebugTrackNode(const size_t node_index) { - track_node_index_ = node_index; + void SetDebugCurrentOnnxNodeIndex(const size_t node_index) { + current_onnx_node_index_ = node_index; } #endif private: @@ -168,7 +168,7 @@ class ModelBuilder { #ifndef NDEBUG // To track and record current node index for debugging - size_t track_node_index_ = 0; + size_t current_onnx_node_index_ = 0; // // An ONNX node might be decomposed into multiple nnapi operations // <1,1> <1,2> <1,3> diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc index 0e78abf999..350078ac78 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc @@ -113,7 +113,7 @@ Status GetTargetDevices(const NnApi& nnapi_handle, TargetDeviceOption target_dev // and exclude nnapi-reference for better performance if possible. // 3) We can easily log the detail of how op was assigned on NNAPI devices which is helpful for debugging. // Related doc and code https://source.android.com/docs/core/interaction/neural-networks#cpu-usage - // and https://android.googlesource.com/platform/frameworks/ml/+/master/nn/runtime/ExecutionPlan.cpp#2303 + // and https://android.googlesource.com/platform/frameworks/ml/+/5b525d4d9100819d87447bd2c2a0bcfdd62899ee/nn/runtime/ExecutionPlan.cpp#2303 if (cpu_index != -1 && cpu_index != static_cast(devices.size()) - 1) { std::swap(devices[devices.size() - 1], devices[cpu_index]); }