aboutsummaryrefslogtreecommitdiff
path: root/tests/CL/Helper.h
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2021-07-14 17:07:23 +0100
committerManuel Bottini <manuel.bottini@arm.com>2021-07-15 09:59:56 +0000
commit7b23732bc8815c7084d4b5f453340fcd740a00fe (patch)
treec7256da469db26c446f4f2d4daa82b223b6ebb25 /tests/CL/Helper.h
parente5d76e1574103de405df625e48e5294ea106060c (diff)
downloadComputeLibrary-7b23732bc8815c7084d4b5f453340fcd740a00fe.tar.gz
Port CLCol2ImKernel to ClCol2ImKernel
Resolves: COMPMID-4517 Change-Id: I50cb02116a1ab86fc29200371944c4774e830746 Signed-off-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5949 Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/CL/Helper.h')
-rw-r--r--tests/CL/Helper.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/CL/Helper.h b/tests/CL/Helper.h
index b99911e1e6..e3e64c9405 100644
--- a/tests/CL/Helper.h
+++ b/tests/CL/Helper.h
@@ -218,6 +218,39 @@ private:
CLFillBorderKernel _border_handler{}; /**< Kernel to handle borders */
std::unique_ptr<ICLKernel> _kernel{}; /**< Kernel to run */
};
+
+/** As above but this also setups a Zero border on the input tensor of the kernel's bordersize */
+template <typename K>
+class ClSynthetizeOperatorWithBorder : public opencl::IClOperator
+{
+public:
+ /** Configure the kernel.
+ *
+ * @param[in] first First configuration argument.
+ * @param[in] args Rest of the configuration arguments.
+ */
+ template <typename T, typename... Args>
+ void configure(T first, Args &&... args)
+ {
+ auto k = std::make_unique<K>();
+ k->configure(CLKernelLibrary::get().get_compile_context(), first, std::forward<Args>(args)...);
+ _kernel = std::move(k);
+
+ auto b = std::make_unique<CLFillBorderKernel>();
+ b->configure(CLKernelLibrary::get().get_compile_context(), first, BorderSize(_kernel->border_size()), BorderMode::CONSTANT, PixelValue());
+ _border_handler = std::move(b);
+ }
+
+ void run(ITensorPack &tensors) override
+ {
+ CLScheduler::get().enqueue(*_border_handler);
+ CLScheduler::get().enqueue_op(*_kernel, tensors);
+ }
+
+private:
+ std::unique_ptr<ICLKernel> _border_handler{ nullptr }; /**< Kernel to handle borders */
+ std::unique_ptr<ICLKernel> _kernel{}; /**< Kernel to run */
+};
} // namespace test
} // namespace arm_compute
#endif /* ARM_COMPUTE_TEST_CL_HELPER_H */