From 2b84be544e4a27f7e8e80827e9c85c8f0d58b4ce Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Wed, 8 Apr 2020 10:15:51 +0100 Subject: COMPMID-3280: Make all ML primitives for CL use the new interface - Part 2 - CLFunctions have been updated Change-Id: Ie3256a6c775bc12f3126482bd8e8a46da54b267c Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3053 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- .../CL/functions/CLElementWiseUnaryLayer.cpp | 49 ++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp') diff --git a/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp b/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp index 9955d240f9..ce615327a9 100644 --- a/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp +++ b/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp @@ -31,9 +31,14 @@ namespace arm_compute { void CLRsqrtLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLRsqrtLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::RSQRT); + k->configure(compile_context, input, output, ElementWiseUnary::RSQRT); _kernel = std::move(k); } Status CLRsqrtLayer::validate(const ITensorInfo *input, const ITensorInfo *output) @@ -42,9 +47,14 @@ Status CLRsqrtLayer::validate(const ITensorInfo *input, const ITensorInfo *outpu } void CLExpLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLExpLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::EXP); + k->configure(compile_context, input, output, ElementWiseUnary::EXP); _kernel = std::move(k); } Status CLExpLayer::validate(const ITensorInfo *input, const ITensorInfo *output) @@ -53,9 +63,14 @@ Status CLExpLayer::validate(const ITensorInfo *input, const ITensorInfo *output) } void CLNegLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLNegLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::NEG); + k->configure(compile_context, input, output, ElementWiseUnary::NEG); _kernel = std::move(k); } Status CLNegLayer::validate(const ITensorInfo *input, const ITensorInfo *output) @@ -64,9 +79,14 @@ Status CLNegLayer::validate(const ITensorInfo *input, const ITensorInfo *output) } void CLSinLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLSinLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::SIN); + k->configure(compile_context, input, output, ElementWiseUnary::SIN); _kernel = std::move(k); } Status CLSinLayer::validate(const ITensorInfo *input, const ITensorInfo *output) @@ -75,9 +95,14 @@ Status CLSinLayer::validate(const ITensorInfo *input, const ITensorInfo *output) } void CLAbsLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLAbsLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::ABS); + k->configure(compile_context, input, output, ElementWiseUnary::ABS); _kernel = std::move(k); } Status CLAbsLayer::validate(const ITensorInfo *input, const ITensorInfo *output) @@ -85,9 +110,14 @@ Status CLAbsLayer::validate(const ITensorInfo *input, const ITensorInfo *output) return CLElementWiseUnaryLayerKernel::validate(input, output, ElementWiseUnary::ABS); } void CLLogLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLLogLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::LOG); + k->configure(compile_context, input, output, ElementWiseUnary::LOG); _kernel = std::move(k); } Status CLLogLayer::validate(const ITensorInfo *input, const ITensorInfo *output) @@ -96,9 +126,14 @@ Status CLLogLayer::validate(const ITensorInfo *input, const ITensorInfo *output) } void CLRoundLayer::configure(const ICLTensor *input, ICLTensor *output) +{ + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLRoundLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { auto k = arm_compute::support::cpp14::make_unique(); - k->configure(input, output, ElementWiseUnary::ROUND); + k->configure(compile_context, input, output, ElementWiseUnary::ROUND); _kernel = std::move(k); } Status CLRoundLayer::validate(const ITensorInfo *input, const ITensorInfo *output) -- cgit v1.2.1