[custom op] Fix custom kernel configuration (#7238)
authorVladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 <v.plazun@samsung.com>
Mon, 9 Sep 2019 01:48:42 +0000 (04:48 +0300)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Mon, 9 Sep 2019 01:48:42 +0000 (10:48 +0900)
Previously tensor address was accidently passed instead of tensor buffer
Correctly store userdata_size insude CustomKernel::configure

Signed-off-by: Vladimir Plazun <v.plazun@samsung.com>
runtimes/neurun/backend/cpu/KernelGenerator.cc
runtimes/neurun/core/src/backend/CustomKernel.cc

index 8e7c2c7..61de754 100644 (file)
@@ -430,7 +430,7 @@ void KernelGenerator::visit(const model::operation::CustomNode &node)
       const auto &operand = _ctx.at(idx);
       // TODO make sure using `_current_subg_layout` is correct for custom operations
       types.emplace_back(get_type_info(operand));
-      auto in_alloc = _tensor_builder->at(idx).get();
+      auto in_alloc = _tensor_builder->at(idx)->buffer();
       allocs.emplace_back(in_alloc);
     }
   };
index 6e6aca9..198e223 100644 (file)
@@ -71,6 +71,7 @@ Kernel::Kernel(const nnfw_custom_eval evalFunction)
 void Kernel::configure(Kernel::CustomKernelConfigParams &&inParams)
 {
   _userdata = inParams.userdata;
+  _userdata_size = inParams.userdata_size;
 
   _params.ninputs = inParams.input_allocations.size();
   _params.inputs = new nnfw_operand[_params.ninputs];