aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/CL
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-05-21 13:32:43 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-06-03 14:51:29 +0000
commit4c5469b192665c94118a8a558787cb9cec2d0765 (patch)
tree168aa969de8243bdbb1f25247dd9f54d037ae32c /arm_compute/core/CL
parent43a129e94df41f9ac8bc78b702da5a387ada0494 (diff)
downloadComputeLibrary-4c5469b192665c94118a8a558787cb9cec2d0765.tar.gz
COMPMID-2225: Add interface support for new quantized data types.
Add support for: -QSYMM8, 8-bit quantized symmetric -QSYMM8_PER_CHANNEL, 8-bit quantized symmetric with per channel quantization Change-Id: I00c4ff98e44af37419470af61419ee95d0de2463 Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-on: https://review.mlplatform.org/c/1236 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/CL')
-rw-r--r--arm_compute/core/CL/CLTypes.h21
-rw-r--r--arm_compute/core/CL/ICLTensor.h9
2 files changed, 28 insertions, 2 deletions
diff --git a/arm_compute/core/CL/CLTypes.h b/arm_compute/core/CL/CLTypes.h
index 4a03cc9637..24ae542c7c 100644
--- a/arm_compute/core/CL/CLTypes.h
+++ b/arm_compute/core/CL/CLTypes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,6 +24,7 @@
#ifndef __ARM_COMPUTE_CL_TYPES_H__
#define __ARM_COMPUTE_CL_TYPES_H__
+#include "arm_compute/core/CL/ICLArray.h"
#include "arm_compute/core/GPUTarget.h"
#include <string>
@@ -53,5 +54,23 @@ struct CLDeviceOptions
size_t num_cores; /**< Number of cores */
size_t cache_size; /**< Cache size */
};
+
+/** OpenCL quantization data */
+struct CLQuantization
+{
+ /** Default Constructor */
+ CLQuantization()
+ : scale(nullptr), offset(nullptr) {};
+ /** Constructor
+ *
+ * @param[in] scale OpenCL scale array
+ * @param[in] offset OpenCL offset array
+ */
+ CLQuantization(const ICLFloatArray *scale, const ICLInt32Array *offset)
+ : scale(scale), offset(offset) {};
+
+ const ICLFloatArray *scale; /**< Quantization scale array */
+ const ICLInt32Array *offset; /**< Quantization offset array */
+};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CL_TYPES_H__ */
diff --git a/arm_compute/core/CL/ICLTensor.h b/arm_compute/core/CL/ICLTensor.h
index 0f5dba923b..094a0c3dec 100644
--- a/arm_compute/core/CL/ICLTensor.h
+++ b/arm_compute/core/CL/ICLTensor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -26,6 +26,8 @@
#include "arm_compute/core/ITensor.h"
+#include "arm_compute/core/CL/CLTypes.h"
+
#include <cstdint>
namespace cl
@@ -53,6 +55,11 @@ public:
/** Default virtual destructor. */
virtual ~ICLTensor() = default;
+ /** Interface to be implemented by the child class to return the wrapped quantization info data
+ *
+ * @return A wrapped quantization info object.
+ */
+ virtual CLQuantization quantization() const = 0;
/** Interface to be implemented by the child class to return a reference to the OpenCL buffer containing the image's data.
*
* @return A reference to an OpenCL buffer containing the image's data.