diff options
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/Acl.hpp | 19 | ||||
-rw-r--r-- | arm_compute/AclDescriptors.h | 9 |
2 files changed, 24 insertions, 4 deletions
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<StatusCode>(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_ */ diff --git a/arm_compute/AclDescriptors.h b/arm_compute/AclDescriptors.h index 7b7655e9c7..a564bd2141 100644 --- a/arm_compute/AclDescriptors.h +++ b/arm_compute/AclDescriptors.h @@ -40,7 +40,7 @@ typedef enum AclLuBoundedRelu = 6, /**< Lower and Upper Bounded Rectifier */ AclLeakyRelu = 7, /**< Leaky Rectifier */ AclSoftRelu = 8, /**< Soft Rectifier */ - AclSoftElu = 9, /**< Exponential Linear Unit */ + AclElu = 9, /**< Exponential Linear Unit */ AclAbs = 10, /**< Absolute */ AclSquare = 11, /**< Square */ AclSqrt = 12, /**< Square root */ @@ -51,9 +51,10 @@ typedef enum /**< Activation layer descriptor */ typedef struct { - AclActivationType type; /**< Activation type */ - float a; /**< Factor &alpha used by some activations */ - float b; /**< Factor &beta used by some activations */ + AclActivationType type; /**< Activation type */ + float a; /**< Factor &alpha used by some activations */ + float b; /**< Factor &beta used by some activations */ + bool inplace; /**< Hint that src and dst tensors will be the same */ } AclActivationDescriptor; #ifdef __cplusplus } |