Provide Q8 sup and comments correction for Arg operation (#4268)
authorShubham Gupta/SNAP /SRI-Bangalore/Engineer/삼성전자 <shub98.gupta@samsung.com>
Tue, 22 Jan 2019 03:50:40 +0000 (09:20 +0530)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 22 Jan 2019 03:50:40 +0000 (12:50 +0900)
1. Provide Q8 sup
2. comments correction

Signed-off-by: shubham <shub98.gupta@samsung.com>
libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArgOperationKernel.h
libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArgOperation.h
libs/ARMComputeEx/src/core/CL/cl_kernels/arg_operation.cl
libs/ARMComputeEx/src/core/CL/kernels/CLArgOperationKernel.cpp
tests/nnapi/nnapi_gtest.skip.armv7l-linux

index 09a6fb5..b98b174 100644 (file)
@@ -66,8 +66,9 @@ public:
   /**
    * @brief Initialise the kernel's input, output and border mode.
    * @param[in]  input          An input tensor. Data types supported: U8/QASYMM8/S32/F32.
-   * @param[out] output         The output tensor, Data types supported: same as @p input.
+   * @param[out] output         The output tensor, Data types supported: S32.
    * @param[in]  axis           Axis along which to reduce. It must be sorted and no duplicates.
+   * @param[in]  op             Arg operation to perform.
    * return N/A
    */
   void configure(const ICLTensor *input, ICLTensor *output, const uint32_t axis, ArgOperation op);
@@ -75,9 +76,9 @@ public:
    * @brief Static function to check if given info will lead to a valid configuration of @ref
    * CLArgOperationKernel
    * @param[in] input           An input tensor info. Data types supported: U8/QASYMM8/S32/F32.
-   * @param[in] output          The output tensor info, Data types supported: same as @p input1.
+   * @param[in] output          The output tensor info, Data types supported: S32.
    * @param[in] axis            Axis along which to reduce. It must be sorted and no duplicates.
-   * Note: U8 requires both inputs to be U8.
+   * @param[in] op              Arg operation to perform.
    * @return a status
    */
   static Status validate(const ITensorInfo *input, const ITensorInfo *output, const uint32_t axis,
index 68f9ada..8d4b95d 100644 (file)
@@ -69,9 +69,9 @@ public:
   /**
    * @brief Initialise the kernel's inputs and outputs.
    * @param[in]  input     Input tensor. Data types supported: U8/QASYMM8/S32/F32.
-   * @param[out] output    The result of arg operation. Data types supported: same as @p
-   * input.
+   * @param[out] output    The result of arg operation. Data types supported: S32.
    * @param[in]  axis      Axis along which to reduce. It must be sorted and no duplicates.
+   * @param[in]  op        Arg operation to perform.
    * @return N/A
    */
   void configure(ICLTensor *input, ICLTensor *output, std::vector<uint32_t> axis, ArgOperation op);
@@ -80,8 +80,8 @@ public:
    * @brief Static function to check if given info will lead to a valid configuration
    * @param[in]  input     Input tensor. Data types supported: U8/QASYMM8/S32/F32.
    * @param[in]  axis      Axis along which to reduce. It must be sorted and no duplicates.
-   * @param[out] output    The result of arg operation. Data types supported: same as @p
-   * input.
+   * @param[out] output    The result of arg operation. Data types supported: S32.
+   * @param[in]  op        Arg operation to perform.
    * @return a status
    */
   static Status validate(const ITensorInfo *input, const std::vector<uint32_t> &axis,
index d785f5f..a7b3550 100644 (file)
@@ -24,7 +24,7 @@
  * @attention Operation type(code) specifying which operation to perform should be passed as preprocessor argument using
  * -DOP_CODE = number. e.g. -DOP_CODE=1
  *
- * @param[in]  input_ptr                            Pointer to the source image. Supported data types: U8/S8/U16/S16/F16/U32/S32/F32
+ * @param[in]  input_ptr                            Pointer to the source image. Supported data types: U8/QASYMM8/S8/U16/S16/F16/U32/S32/F32
  * @param[in]  input_stride_x                       Stride of the source image in X dimension (in bytes)
  * @param[in]  input_step_x                         input_stride_x * number of elements along X processed per workitem(in bytes)
  * @param[in]  input_stride_y                       Stride of the source image in Y dimension (in bytes)
index bd09a07..fd07898 100644 (file)
@@ -39,7 +39,8 @@ namespace
 Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, const uint32_t axis,
                           ArgOperation /*op*/)
 {
-  ARM_COMPUTE_ERROR_ON_DATA_TYPE_NOT_IN(input, DataType::S32, DataType::F32, DataType::U8);
+  ARM_COMPUTE_ERROR_ON_DATA_TYPE_NOT_IN(input, DataType::S32, DataType::F32, DataType::U8,
+                                        DataType::QASYMM8);
   ARM_COMPUTE_ERROR_ON_DATA_TYPE_NOT_IN(output, DataType::S32);
 
   ARM_COMPUTE_RETURN_ERROR_ON_MSG(input->tensor_shape().num_dimensions() !=
@@ -91,7 +92,7 @@ void CLArgOperationKernel::configure(const ICLTensor *input, ICLTensor *output,
 
   // Set kernel build options
   std::set<std::string> build_opts;
-  build_opts.emplace("-DDATA_TYPE=" + get_cl_type_from_data_type(output_info->data_type()));
+  build_opts.emplace("-DDATA_TYPE=" + get_cl_type_from_data_type(input->info()->data_type()));
   build_opts.emplace("-DDEPTH_OUT=" + support::cpp11::to_string(output_info->dimension(2)));
   build_opts.emplace("-DOP_CODE=" + support::cpp11::to_string(op_code));
 
index bc49f94..3d39c63 100644 (file)
@@ -1,4 +1,3 @@
-GeneratedTests.argmax_ex_quant8*
 GeneratedTests.logistic_quant8_1
 GeneratedTests.logistic_quant8_2
 GeneratedTests.lsh_projection