aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/experimental/Types.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/core/experimental/Types.h')
-rw-r--r--arm_compute/core/experimental/Types.h65
1 files changed, 47 insertions, 18 deletions
diff --git a/arm_compute/core/experimental/Types.h b/arm_compute/core/experimental/Types.h
index 92ece460dc..63a3a1a1ec 100644
--- a/arm_compute/core/experimental/Types.h
+++ b/arm_compute/core/experimental/Types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021 Arm Limited.
+ * Copyright (c) 2020-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ARM_COMPUTE_EXPERIMENTAL_TYPES_H
-#define ARM_COMPUTE_EXPERIMENTAL_TYPES_H
+#ifndef ACL_ARM_COMPUTE_CORE_EXPERIMENTAL_TYPES_H
+#define ACL_ARM_COMPUTE_CORE_EXPERIMENTAL_TYPES_H
#include "arm_compute/core/ITensorPack.h"
#include "arm_compute/core/TensorShape.h"
@@ -39,15 +39,26 @@ enum TensorType : int32_t
{
ACL_UNKNOWN = -1,
ACL_SRC_DST = 0,
+
+ // Src
ACL_SRC = 0,
ACL_SRC_0 = 0,
ACL_SRC_1 = 1,
ACL_SRC_2 = 2,
+ ACL_SRC_3 = 3,
+ ACL_SRC_4 = 4,
+ ACL_SRC_5 = 5,
+ ACL_SRC_6 = 6,
+ ACL_SRC_END = 6,
+
+ // Dst
ACL_DST = 30,
ACL_DST_0 = 30,
ACL_DST_1 = 31,
ACL_DST_2 = 32,
- ACL_BIAS = ACL_SRC_2,
+ ACL_DST_END = 32,
+
+ // Aux
ACL_INT = 50,
ACL_INT_0 = 50,
ACL_INT_1 = 51,
@@ -56,7 +67,17 @@ enum TensorType : int32_t
ACL_INT_4 = 54,
ACL_SRC_VEC = 256,
ACL_DST_VEC = 512,
- ACL_INT_VEC = 1024
+ ACL_INT_VEC = 1024,
+
+ // Aliasing Types
+ // Conv etc
+ ACL_BIAS = ACL_SRC_2,
+
+ // Gemm
+ ACL_VEC_ROW_SUM = ACL_SRC_3,
+ ACL_VEC_COL_SUM = ACL_SRC_4,
+ ACL_SHIFTS = ACL_SRC_5,
+ ACL_MULTIPLIERS = ACL_SRC_6,
};
namespace experimental
@@ -71,27 +92,35 @@ struct MemoryInfo
{
MemoryInfo() = default;
- MemoryInfo(int slot, size_t size, size_t alignment = 0) noexcept
- : slot(slot),
- size(size),
- alignment(alignment)
+ MemoryInfo(int slot, size_t size, size_t alignment = 0) noexcept : slot(slot), size(size), alignment(alignment)
{
}
MemoryInfo(int slot, MemoryLifetime lifetime, size_t size, size_t alignment = 0) noexcept
- : slot(slot),
- lifetime(lifetime),
- size(size),
- alignment(alignment)
+ : slot(slot), lifetime(lifetime), size(size), alignment(alignment)
{
}
- int slot{ ACL_UNKNOWN };
- MemoryLifetime lifetime{ MemoryLifetime::Temporary };
- size_t size{ 0 };
- size_t alignment{ 64 };
+
+ bool merge(int slot, size_t new_size, size_t new_alignment = 0) noexcept
+ {
+ if (slot != this->slot)
+ {
+ return false;
+ }
+
+ size = std::max(size, new_size);
+ alignment = std::max(alignment, new_alignment);
+
+ return true;
+ }
+
+ int slot{ACL_UNKNOWN};
+ MemoryLifetime lifetime{MemoryLifetime::Temporary};
+ size_t size{0};
+ size_t alignment{64};
};
using MemoryRequirements = std::vector<MemoryInfo>;
} // namespace experimental
} // namespace arm_compute
-#endif /* ARM_COMPUTE_EXPERIMENTAL_TYPES_H */
+#endif // ACL_ARM_COMPUTE_CORE_EXPERIMENTAL_TYPES_H