aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/core')
-rw-r--r--arm_compute/core/ITensorPack.h19
-rw-r--r--arm_compute/core/Types.h8
-rw-r--r--arm_compute/core/experimental/Types.h30
3 files changed, 41 insertions, 16 deletions
diff --git a/arm_compute/core/ITensorPack.h b/arm_compute/core/ITensorPack.h
index 8aea880bb6..2f41d4d51e 100644
--- a/arm_compute/core/ITensorPack.h
+++ b/arm_compute/core/ITensorPack.h
@@ -24,9 +24,11 @@
#ifndef ARM_COMPUTE_ITENSORPACK_H
#define ARM_COMPUTE_ITENSORPACK_H
+#include "arm_compute/core/experimental/Types.h"
+
#include <cstddef>
#include <cstdint>
-#include <map>
+#include <unordered_map>
namespace arm_compute
{
@@ -36,19 +38,20 @@ class ITensor;
/** Tensor packing service */
class ITensorPack
{
-private:
+public:
struct PackElement
{
PackElement() = default;
- PackElement(ITensor *tensor)
- : tensor(tensor), ctensor(nullptr)
+ PackElement(int id, ITensor *tensor)
+ : id(id), tensor(tensor), ctensor(nullptr)
{
}
- PackElement(const ITensor *ctensor)
- : tensor(nullptr), ctensor(ctensor)
+ PackElement(int id, const ITensor *ctensor)
+ : id(id), tensor(nullptr), ctensor(ctensor)
{
}
+ int id{ -1 };
ITensor *tensor{ nullptr };
const ITensor *ctensor{ nullptr };
};
@@ -56,6 +59,8 @@ private:
public:
/** Default Constructor */
ITensorPack() = default;
+ /** Initializer list Constructor */
+ ITensorPack(std::initializer_list<PackElement> l);
/** Add tensor to the pack
*
* @param[in] id ID/type of the tensor to add
@@ -102,7 +107,7 @@ public:
bool empty() const;
private:
- std::map<unsigned int, PackElement> _pack{}; /**< Container with the packed tensors */
+ std::unordered_map<int, PackElement> _pack{}; /**< Container with the packed tensors */
};
} // namespace arm_compute
#endif /*ARM_COMPUTE_ITENSORPACK_H */
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h
index 9e054f26dd..ec9c419dbc 100644
--- a/arm_compute/core/Types.h
+++ b/arm_compute/core/Types.h
@@ -1753,11 +1753,11 @@ private:
/** GEMM reshape information class. This class stores the necessary information about matrix A and matrix B reshape.
*
- * The matrix A can only be reshaped through @ref CLGEMMReshapeLHSMatrixKernel or @ref NEGEMMInterleave4x4Kernel
- * Note: Optionally just for @ref CLGEMMReshapeLHSMatrixKernel is it possible to set mult_interleave4x4_height, the multiplication factor for the height of the 4x4 interleaved block
+ * The matrix A can only be reshaped through @ref opencl::kernels::ClGemmReshapeLhsMatrixKernel or @ref NEGEMMInterleave4x4Kernel
+ * Note: Optionally just for @ref opencl::kernels::ClGemmReshapeLhsMatrixKernel is it possible to set mult_interleave4x4_height, the multiplication factor for the height of the 4x4 interleaved block
*
- * The matrix B can only be reshaped through @ref CLGEMMReshapeRHSMatrixKernel or @ref NEGEMMTranspose1xWKernel
- * Note: Optionally just for @ref CLGEMMReshapeRHSMatrixKernel is it possible to set mult_transpose1xW_width, the multiplication factor for the width of the 1xW transposed block
+ * The matrix B can only be reshaped through @ref opencl::kernels::ClGemmReshapeRhsMatrixKernel or @ref NEGEMMTranspose1xWKernel
+ * Note: Optionally just for @ref opencl::kernels::ClGemmReshapeRhsMatrixKernel is it possible to set mult_transpose1xW_width, the multiplication factor for the width of the 1xW transposed block
*
*/
class GEMMReshapeInfo final
diff --git a/arm_compute/core/experimental/Types.h b/arm_compute/core/experimental/Types.h
index 7ddb930421..92ece460dc 100644
--- a/arm_compute/core/experimental/Types.h
+++ b/arm_compute/core/experimental/Types.h
@@ -47,6 +47,7 @@ enum TensorType : int32_t
ACL_DST_0 = 30,
ACL_DST_1 = 31,
ACL_DST_2 = 32,
+ ACL_BIAS = ACL_SRC_2,
ACL_INT = 50,
ACL_INT_0 = 50,
ACL_INT_1 = 51,
@@ -54,21 +55,40 @@ enum TensorType : int32_t
ACL_INT_3 = 53,
ACL_INT_4 = 54,
ACL_SRC_VEC = 256,
+ ACL_DST_VEC = 512,
+ ACL_INT_VEC = 1024
};
namespace experimental
{
+enum class MemoryLifetime
+{
+ Temporary = 0,
+ Persistent = 1,
+ Prepare = 2,
+};
struct MemoryInfo
{
- MemoryInfo(TensorType type, size_t size, size_t alignment) noexcept
- : type(type),
+ MemoryInfo() = default;
+
+ 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)
{
}
- TensorType type;
- size_t size;
- size_t alignment;
+ int slot{ ACL_UNKNOWN };
+ MemoryLifetime lifetime{ MemoryLifetime::Temporary };
+ size_t size{ 0 };
+ size_t alignment{ 64 };
};
using MemoryRequirements = std::vector<MemoryInfo>;