From: Vladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 Date: Mon, 9 Sep 2019 01:48:42 +0000 (+0300) Subject: [custom op] Fix custom kernel configuration (#7238) X-Git-Tag: accepted/tizen/unified/20190911.111615~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9879e83bb885f46f37b644ad3e2bd06266c46862;p=platform%2Fcore%2Fml%2Fnnfw.git [custom op] Fix custom kernel configuration (#7238) Previously tensor address was accidently passed instead of tensor buffer Correctly store userdata_size insude CustomKernel::configure Signed-off-by: Vladimir Plazun --- diff --git a/runtimes/neurun/backend/cpu/KernelGenerator.cc b/runtimes/neurun/backend/cpu/KernelGenerator.cc index 8e7c2c7..61de754 100644 --- a/runtimes/neurun/backend/cpu/KernelGenerator.cc +++ b/runtimes/neurun/backend/cpu/KernelGenerator.cc @@ -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); } }; diff --git a/runtimes/neurun/core/src/backend/CustomKernel.cc b/runtimes/neurun/core/src/backend/CustomKernel.cc index 6e6aca9..198e223 100644 --- a/runtimes/neurun/core/src/backend/CustomKernel.cc +++ b/runtimes/neurun/core/src/backend/CustomKernel.cc @@ -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];