Fix coverity 1148326 accepted/tizen/unified/20200909.155544 submit/tizen/20200909.065947
authorChunseok Lee <chunseok.lee@samsung.com>
Wed, 9 Sep 2020 03:58:01 +0000 (12:58 +0900)
committerChunseok Lee <chunseok.lee@samsung.com>
Wed, 9 Sep 2020 06:59:05 +0000 (15:59 +0900)
- Fix coverity 1148326

Change-Id: I98d2ff22050078bd8a392a58904b968965c1c46d
Signed-off-by: Chunseok Lee <chunseok.lee@samsung.com>
compute/ARMComputeEx/src/runtime/CL/functions/CLReduceOperation.cpp

index 321d5c5..b198e73 100644 (file)
@@ -120,7 +120,10 @@ void CLReduceOperation::configure(ICLTensor *input, ICLTensor *output,
   const size_t num_of_kernels = axis.size();
   const size_t num_of_interm_tensors = num_of_kernels - (keep_dims ? 1 : 0);
 
-  ARM_COMPUTE_ERROR_ON(num_of_kernels < 1);
+  if (num_of_kernels < 1)
+  {
+    throw std::runtime_error("CLReduceOperation: there is no axis to reduce");
+  }
 
   _interm_tensors = support::cpp14::make_unique<CLTensor[]>(num_of_interm_tensors);
   _reduce_kernels = support::cpp14::make_unique<CLReduceOperationKernel[]>(num_of_kernels);