From 4164814a099773c0a512889473c980bc148e590f Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 3 Aug 2021 08:24:00 +0100 Subject: Implement Operator API Resolves: COMPMID-4512 Signed-off-by: Georgios Pinitas Change-Id: Id12130365fa3fe2261160931dcc7affb6b467186 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6031 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- arm_compute/Acl.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'arm_compute/Acl.hpp') diff --git a/arm_compute/Acl.hpp b/arm_compute/Acl.hpp index 7791c5633e..55e04e876d 100644 --- a/arm_compute/Acl.hpp +++ b/arm_compute/Acl.hpp @@ -87,6 +87,7 @@ OBJECT_DELETER(AclContext, AclDestroyContext) OBJECT_DELETER(AclQueue, AclDestroyQueue) OBJECT_DELETER(AclTensor, AclDestroyTensor) OBJECT_DELETER(AclTensorPack, AclDestroyTensorPack) +OBJECT_DELETER(AclOperator, AclDestroyOperator) #undef OBJECT_DELETER @@ -773,6 +774,24 @@ protected: /** Constructor */ Operator() = default; }; + +/// Operators +using ActivationDesc = AclActivationDescriptor; +class Activation : public Operator +{ +public: + Activation(Context &ctx, const TensorDescriptor &src, const TensorDescriptor &dst, const ActivationDesc &desc, StatusCode *status = nullptr) + { + AclOperator op; + const auto st = detail::as_enum(AclActivation(&op, ctx.get(), src.get(), dst.get(), desc)); + reset(op); + report_status(st, "[Compute Library] Failure during Activation operator creation"); + if(status) + { + *status = st; + } + } +}; } // namespace acl #undef ARM_COMPUTE_IGNORE_UNUSED #endif /* ARM_COMPUTE_ACL_HPP_ */ -- cgit v1.2.1