From 4ea76dc02d0f21fcba15467b24b610d790eb5b9c Mon Sep 17 00:00:00 2001 From: Ashutosh Parkhi Date: Wed, 21 Dec 2022 12:22:04 +0000 Subject: [PATCH] [ETHOSN] Fix for the mock inference after NPU driver update Change-Id: Iffc7b0c8070d30d63e0aa899581418da0555d0f9 --- src/runtime/contrib/ethosn/ethosn_device.cc | 2 +- src/runtime/contrib/ethosn/ethosn_runtime.cc | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/runtime/contrib/ethosn/ethosn_device.cc b/src/runtime/contrib/ethosn/ethosn_device.cc index 7e16f7e887f3..d4ebec4de311 100644 --- a/src/runtime/contrib/ethosn/ethosn_device.cc +++ b/src/runtime/contrib/ethosn/ethosn_device.cc @@ -272,7 +272,7 @@ TVM_REGISTER_GLOBAL("relay.ethos-n.test.infra.inference_result") // Allow the ethos-n support code to be tested without a device bool Inference(tvm::runtime::TVMArgs args, #ifdef _ETHOSN_API_VERSION_3_2_0 - dl::ProcMemAllocator* proc_mem_alloc, + dl::ProcMemAllocator* /*proc_mem_alloc*/, #endif dl::Network* /* npu */, const std::vector& input_order, const std::vector& output_order, const std::vector& input_sizes, diff --git a/src/runtime/contrib/ethosn/ethosn_runtime.cc b/src/runtime/contrib/ethosn/ethosn_runtime.cc index 11edc8c71a2c..0b68db1a1798 100644 --- a/src/runtime/contrib/ethosn/ethosn_runtime.cc +++ b/src/runtime/contrib/ethosn/ethosn_runtime.cc @@ -114,9 +114,6 @@ Module EthosnModule::LoadFromBinary(void* strm) { cmms.resize(func_count); for (unsigned int i = 0; i < func_count; i++) { OrderedCompiledNetwork& compiled = cmms[i]; -#ifdef _ETHOSN_API_VERSION_3_2_0 - compiled.proc_mem_alloc = std::make_unique(); -#endif std::string ext_symbol; std::string cmm; uint64_t input_size; @@ -130,6 +127,7 @@ Module EthosnModule::LoadFromBinary(void* strm) { // If hardware unavaiable use the mock inference functionality. If hardware is // avaiable, deserialize the compiled graph. #ifdef _ETHOSN_API_VERSION_3_2_0 + compiled.proc_mem_alloc = std::make_unique(); compiled.runtime_cmm = std::make_unique( compiled.proc_mem_alloc->CreateNetwork(cmm.c_str(), cmm.size())); #else