From 3c5f949ad73fff961a7d193c9275b73df13b8096 Mon Sep 17 00:00:00 2001 From: John Richardson Date: Wed, 4 Oct 2017 15:27:37 +0100 Subject: COMPMID-575: Port Magnitude to new validation Change-Id: I2600947bef30853d00adfa4b919dbcb860de9bfd Reviewed-on: http://mpd-gerrit.cambridge.arm.com/91717 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- src/runtime/CL/functions/CLMagnitude.cpp | 4 +++- src/runtime/NEON/functions/NEMagnitude.cpp | 32 +++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/CL/functions/CLMagnitude.cpp b/src/runtime/CL/functions/CLMagnitude.cpp index 68b8c3545a..9d6ac7a11a 100644 --- a/src/runtime/CL/functions/CLMagnitude.cpp +++ b/src/runtime/CL/functions/CLMagnitude.cpp @@ -30,8 +30,10 @@ using namespace arm_compute; -void CLMagnitude::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, MagnitudeType mag_type) +void CLMagnitude::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, MagnitudeType mag_type, bool use_fp16) { + ARM_COMPUTE_UNUSED(use_fp16); //TODO(COMPMID-644): Add half float support + auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, nullptr, mag_type); _kernel = std::move(k); diff --git a/src/runtime/NEON/functions/NEMagnitude.cpp b/src/runtime/NEON/functions/NEMagnitude.cpp index 7877995d6b..f86505449f 100644 --- a/src/runtime/NEON/functions/NEMagnitude.cpp +++ b/src/runtime/NEON/functions/NEMagnitude.cpp @@ -31,18 +31,36 @@ using namespace arm_compute; -void NEMagnitude::configure(const ITensor *input1, const ITensor *input2, ITensor *output, bool use_fp16) +void NEMagnitude::configure(const ITensor *input1, const ITensor *input2, ITensor *output, MagnitudeType mag_type, bool use_fp16) { if(use_fp16) { - auto k = arm_compute::support::cpp14::make_unique>(); - k->configure(input1, input2, output, nullptr); - _kernel = std::move(k); + if(mag_type == MagnitudeType::L1NORM) + { + auto k = arm_compute::support::cpp14::make_unique>(); + k->configure(input1, input2, output, nullptr); + _kernel = std::move(k); + } + else + { + auto k = arm_compute::support::cpp14::make_unique>(); + k->configure(input1, input2, output, nullptr); + _kernel = std::move(k); + } } else { - auto k = arm_compute::support::cpp14::make_unique>(); - k->configure(input1, input2, output, nullptr); - _kernel = std::move(k); + if(mag_type == MagnitudeType::L1NORM) + { + auto k = arm_compute::support::cpp14::make_unique>(); + k->configure(input1, input2, output, nullptr); + _kernel = std::move(k); + } + else + { + auto k = arm_compute::support::cpp14::make_unique>(); + k->configure(input1, input2, output, nullptr); + _kernel = std::move(k); + } } } -- cgit v1.2.1