summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrasanna R/SNAP /SRI-Bangalore/Engineer/삼성전자 <prasanna.r@samsung.com>2018-12-14 12:41:48 +0530
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2018-12-14 16:11:48 +0900
commit4c0e194a33ba4fe17b39888b01f15051714ec265 (patch)
tree1681742440564353fef643ebe9721fbe90cf6478
parentb86a8251b9511016298322b47d60af55f42a4ec5 (diff)
downloadnnfw-4c0e194a33ba4fe17b39888b01f15051714ec265.tar.gz
nnfw-4c0e194a33ba4fe17b39888b01f15051714ec265.tar.bz2
nnfw-4c0e194a33ba4fe17b39888b01f15051714ec265.zip
Changes in DataType supported by CL and host files of SquaredDifference and Neg (#4013)
This patch adds changes in DataType supported by CL and host files of SquaredDifference and Neg Reference NeuralNetworksEx.h Signed-off-by: prasannar <prasanna.r@samsung.com>
-rw-r--r--libs/ARMComputeEx/src/core/CL/cl_kernels/neg_tensor.cl2
-rw-r--r--libs/ARMComputeEx/src/core/CL/cl_kernels/squared_difference.cl4
-rw-r--r--libs/ARMComputeEx/src/core/CL/kernels/CLNegKernel.cpp8
-rw-r--r--libs/ARMComputeEx/src/core/CL/kernels/CLSquaredDifferenceKernel.cpp6
4 files changed, 10 insertions, 10 deletions
diff --git a/libs/ARMComputeEx/src/core/CL/cl_kernels/neg_tensor.cl b/libs/ARMComputeEx/src/core/CL/cl_kernels/neg_tensor.cl
index 54fc826a6..43b48f200 100644
--- a/libs/ARMComputeEx/src/core/CL/cl_kernels/neg_tensor.cl
+++ b/libs/ARMComputeEx/src/core/CL/cl_kernels/neg_tensor.cl
@@ -21,7 +21,7 @@
* @attention Vector size should be given as a preprocessor argument using -DVEC_SIZE=size. e.g. -DVEC_SIZE=16
* @attention Data type can be passed using the -DDATA_TYPE compile flag, e.g. -DDATA_TYPE=float
*
- * @param[in] in_ptr Pointer to the source image. Supported data types: F16/F32.
+ * @param[in] in_ptr Pointer to the source image. Supported data types: S16/S32/F16/F32.
* @param[in] in_stride_x Stride of the source image in X dimension (in bytes)
* @param[in] in_step_x in_stride_x * number of elements along X processed per work item (in bytes)
* @param[in] in_offset_first_element_in_bytes Offset of the first element in the source image
diff --git a/libs/ARMComputeEx/src/core/CL/cl_kernels/squared_difference.cl b/libs/ARMComputeEx/src/core/CL/cl_kernels/squared_difference.cl
index de8602df7..95c93b98a 100644
--- a/libs/ARMComputeEx/src/core/CL/cl_kernels/squared_difference.cl
+++ b/libs/ARMComputeEx/src/core/CL/cl_kernels/squared_difference.cl
@@ -22,7 +22,7 @@
* @attention Vector size should be given as a preprocessor argument using -DVEC_SIZE=size. e.g. -DVEC_SIZE=16
* @note Can only take floating point data types.
*
- * @param[in] input1_ptr Pointer to the source image. Supported data types: F16/F32
+ * @param[in] input1_ptr Pointer to the source image. Supported data types: S16/S32/F16/F32
* @param[in] input1_stride_x Stride of the source image in X dimension (in bytes)
* @param[in] input1_step_x input1_stride_x * number of elements along X processed per workitem(in bytes)
* @param[in] input1_stride_y Stride of the source image in Y dimension (in bytes)
@@ -31,7 +31,7 @@
* @param[in] input1_step_z input1_stride_z * number of elements along Z processed per workitem(in bytes)
* @param[in] input1_offset_first_element_in_bytes The offset of the first element in the source image
*
- * @param[in] input2_ptr Pointer to the source image. Supported data types: F16/F32
+ * @param[in] input2_ptr Pointer to the source image. Supported data types: S16/S32/F16/F32
* @param[in] input2_stride_x Stride of the source image in X dimension (in bytes)
* @param[in] input2_step_x input2_stride_x * number of elements along X processed per workitem(in bytes)
* @param[in] input2_stride_y Stride of the source image in Y dimension (in bytes)
diff --git a/libs/ARMComputeEx/src/core/CL/kernels/CLNegKernel.cpp b/libs/ARMComputeEx/src/core/CL/kernels/CLNegKernel.cpp
index 4344a3484..d6ae75d6f 100644
--- a/libs/ARMComputeEx/src/core/CL/kernels/CLNegKernel.cpp
+++ b/libs/ARMComputeEx/src/core/CL/kernels/CLNegKernel.cpp
@@ -26,10 +26,10 @@ namespace
{
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output)
{
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::U8, DataType::S16,
- DataType::S32, DataType::F16, DataType::F32);
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::U8, DataType::S16,
- DataType::S32, DataType::F16, DataType::F32);
+ ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::S16, DataType::S32,
+ DataType::F16, DataType::F32);
+ ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::S16, DataType::S32,
+ DataType::F16, DataType::F32);
ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS(input->info()->tensor_shape(),
output->info()->tensor_shape());
ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
diff --git a/libs/ARMComputeEx/src/core/CL/kernels/CLSquaredDifferenceKernel.cpp b/libs/ARMComputeEx/src/core/CL/kernels/CLSquaredDifferenceKernel.cpp
index fa8849257..e99aaa399 100644
--- a/libs/ARMComputeEx/src/core/CL/kernels/CLSquaredDifferenceKernel.cpp
+++ b/libs/ARMComputeEx/src/core/CL/kernels/CLSquaredDifferenceKernel.cpp
@@ -32,9 +32,9 @@ Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITen
const TensorShape &out_shape =
TensorShape::broadcast_shape(input1->tensor_shape(), input2->tensor_shape());
- ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input1, 1, DataType::U8, DataType::S16,
+ ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input1, 1, DataType::S16, DataType::S32,
DataType::F16, DataType::F32);
- ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input2, 1, DataType::U8, DataType::S16,
+ ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input2, 1, DataType::S16, DataType::S32,
DataType::F16, DataType::F32);
ARM_COMPUTE_RETURN_ERROR_ON_MSG(out_shape.total_size() == 0,
@@ -42,7 +42,7 @@ Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITen
// Validate in case of configured output
if (output->total_size() > 0)
{
- ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::U8, DataType::S16,
+ ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::S16, DataType::S32,
DataType::F16, DataType::F32);
ARM_COMPUTE_RETURN_ERROR_ON_MSG(
detail::have_different_dimensions(out_shape, output->tensor_shape(), 0),