From 5e96be7707a571b136dc64256af399dbbb0fdfe0 Mon Sep 17 00:00:00 2001 From: Vidhya Sudhan Loganathan Date: Tue, 18 Dec 2018 14:17:00 +0000 Subject: COMPMID-1722 : CL: Implement Range Change-Id: I88da6eb5289c303b1dc91606c1560ce629746058 Reviewed-on: https://review.mlplatform.org/381 Reviewed-by: Gian Marco Iodice Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- src/runtime/CL/functions/CLRange.cpp | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/runtime/CL/functions/CLRange.cpp (limited to 'src/runtime/CL') diff --git a/src/runtime/CL/functions/CLRange.cpp b/src/runtime/CL/functions/CLRange.cpp new file mode 100644 index 0000000000..b2cd472d02 --- /dev/null +++ b/src/runtime/CL/functions/CLRange.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/runtime/CL/functions/CLRange.h" + +#include "arm_compute/core/CL/ICLTensor.h" +#include "arm_compute/core/CL/kernels/CLRangeKernel.h" +#include "arm_compute/core/Error.h" +#include "arm_compute/core/Validate.h" +#include "arm_compute/runtime/CL/CLScheduler.h" +#include "support/ToolchainSupport.h" + +using namespace arm_compute; + +void CLRange::configure(ICLTensor *output, const float start, const float end, const float step) +{ + auto k = arm_compute::support::cpp14::make_unique(); + k->set_target(CLScheduler::get().target()); + k->configure(output, start, end, step); + _kernel = std::move(k); + + // Tune kernels + CLScheduler::get().tune_kernel_static(*_kernel); +} + +Status CLRange::validate(const ITensorInfo *output, const float start, const float end, const float step) +{ + return CLRangeKernel::validate(output, start, end, step); +} -- cgit v1.2.1