diff options
Diffstat (limited to 'src/common/IContext.h')
-rw-r--r-- | src/common/IContext.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/common/IContext.h b/src/common/IContext.h index 31f39da06d..a221e5db61 100644 --- a/src/common/IContext.h +++ b/src/common/IContext.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. + * Copyright (c) 2021,2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,10 +29,11 @@ #include "src/common/utils/Object.h" #include <atomic> +#include <tuple> struct AclContext_ { - arm_compute::detail::Header header{ arm_compute::detail::ObjectType::Context, nullptr }; + arm_compute::detail::Header header{arm_compute::detail::ObjectType::Context, nullptr}; protected: AclContext_() = default; @@ -44,22 +45,20 @@ namespace arm_compute // Forward declarations class ITensorV2; class IQueue; +class IOperator; /**< Context interface */ class IContext : public AclContext_ { public: - IContext(Target target) - : AclContext_(), _target(target), _refcount(0) + IContext(Target target) : AclContext_(), _target(target), _refcount(0) { } - /** Virtual Destructor */ virtual ~IContext() { header.type = detail::ObjectType::Invalid; }; - /** Target type accessor * * @return Target that the context is associated with @@ -68,19 +67,16 @@ public: { return _target; } - /** Increment context refcount */ void inc_ref() const { ++_refcount; } - /** Decrement context refcount */ void dec_ref() const { --_refcount; } - /** Reference counter accessor * * @return The number of references pointing to this object @@ -89,7 +85,6 @@ public: { return _refcount; } - /** Checks if an object is valid * * @return True if sucessful otherwise false @@ -98,7 +93,6 @@ public: { return header.type == detail::ObjectType::Context; } - /** Create a tensor object * * @param[in] desc Descriptor to use @@ -107,14 +101,17 @@ public: * @return A pointer to the created tensor object */ virtual ITensorV2 *create_tensor(const AclTensorDescriptor &desc, bool allocate) = 0; - /** Create a queue object * * @param[in] options Queue options to be used * * @return A pointer to the created queue object */ - virtual IQueue *create_queue(const AclQueueOptions *options) = 0; + virtual IQueue *create_queue(const AclQueueOptions *options) = 0; + virtual std::tuple<IOperator *, StatusCode> create_activation(const AclTensorDescriptor &src, + const AclTensorDescriptor &dst, + const AclActivationDescriptor &act, + bool is_validate) = 0; private: Target _target; /**< Target type of context */ @@ -142,7 +139,7 @@ namespace detail */ inline StatusCode validate_internal_context(const IContext *ctx) { - if(ctx == nullptr || !ctx->is_valid()) + if (ctx == nullptr || !ctx->is_valid()) { ARM_COMPUTE_LOG_ERROR_ACL("Invalid context object"); return StatusCode::InvalidArgument; |