From 69766d60896e429f27ac094010ae1f30ebbdc630 Mon Sep 17 00:00:00 2001 From: Anitha Raj Date: Tue, 21 Nov 2023 11:19:50 +0000 Subject: Revert "Fix various coverity issues" This reverts commit 26c68a0e5f555e316cab18352fa3b62f22af8bfb. Signed-off-by: Anitha Raj Change-Id: I3a71762d1fa8b0a97ebf21fa1c1e4da94d39e887 --- src/core/CL/CLMutableCommandBuffer.cpp | 7 +------ src/cpu/operators/internal/CpuGemmAssemblyDispatch.cpp | 6 ++---- src/gpu/cl/operators/ClMatMul.cpp | 2 ++ src/runtime/CL/CLMemoryRegion.cpp | 11 +---------- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/core/CL/CLMutableCommandBuffer.cpp b/src/core/CL/CLMutableCommandBuffer.cpp index 0e078d8416..05b351fc25 100644 --- a/src/core/CL/CLMutableCommandBuffer.cpp +++ b/src/core/CL/CLMutableCommandBuffer.cpp @@ -26,7 +26,6 @@ #include "arm_compute/core/Error.h" -#include "src/common/utils/Log.h" #include "src/core/CL/CLUtils.h" namespace arm_compute @@ -49,11 +48,7 @@ CLMutableCommandBuffer::CLMutableCommandBuffer(cl_command_queue queue) : CLComma CLMutableCommandBuffer::~CLMutableCommandBuffer() { const auto status = clReleaseCommandBufferKHR(_cb); - if (status != CL_SUCCESS) - { - const std::string error_message = "clReleaseCommandBufferKHR - Error code: " + std::to_string(status); - ARM_COMPUTE_LOG_ERROR_ACL(error_message); - } + handle_cl_error("clReleaseCommandBufferKHR", status); } void CLMutableCommandBuffer::add_kernel(cl_kernel kernel, diff --git a/src/cpu/operators/internal/CpuGemmAssemblyDispatch.cpp b/src/cpu/operators/internal/CpuGemmAssemblyDispatch.cpp index 611bc76463..82bd465c99 100644 --- a/src/cpu/operators/internal/CpuGemmAssemblyDispatch.cpp +++ b/src/cpu/operators/internal/CpuGemmAssemblyDispatch.cpp @@ -541,7 +541,6 @@ void Fallback::prepare(ITensorPack &tensors) { auto b = tensors.get_const_tensor(TensorType::ACL_SRC_1); auto c = tensors.get_const_tensor(TensorType::ACL_SRC_2); - ARM_COMPUTE_ERROR_ON_NULLPTR(b); // Setup up matrix bias in the assembly kernel, it's just a pointer to matrix C. if (c && c->info()->data_type() == DataType::S32) @@ -615,7 +614,6 @@ void Fallback::run(ITensorPack &tensors) auto b = tensors.get_const_tensor(TensorType::ACL_SRC_1); auto c = tensors.get_const_tensor(TensorType::ACL_SRC_2); auto d = tensors.get_tensor(TensorType::ACL_DST); - ARM_COMPUTE_ERROR_ON_NULLPTR(a, d); int lda = a->info()->strides_in_bytes().y() / a->info()->element_size(); int ldb = 0; @@ -654,7 +652,7 @@ void Fallback::run(ITensorPack &tensors) } // Check if B is pre-tranposed and de-reference if not - if (b_to_use && !_gemm_kernel_asm->B_is_pretransposed()) + if (!_gemm_kernel_asm->B_is_pretransposed()) { ldb = b_to_use->info()->strides_in_bytes().y() / b_to_use->info()->element_size(); multi_stride_b = b_to_use->info()->strides_in_bytes().z() / b_to_use->info()->element_size(); @@ -672,7 +670,7 @@ void Fallback::run(ITensorPack &tensors) } // Pretranspose B if required - if (b_to_use && _B_pretranspose_required) + if (_B_pretranspose_required) { // Fixed format kernels need no pretranspose. ARM_COMPUTE_ERROR_ON(arm_compute::is_fixed_format( diff --git a/src/gpu/cl/operators/ClMatMul.cpp b/src/gpu/cl/operators/ClMatMul.cpp index 43303001d0..9962ee550a 100644 --- a/src/gpu/cl/operators/ClMatMul.cpp +++ b/src/gpu/cl/operators/ClMatMul.cpp @@ -91,6 +91,8 @@ MatMulKernelType get_matmul_kernel(const ITensorInfo *lhs, return MatMulKernelType::NATIVE_FP; } + + return is_quantized ? MatMulKernelType::NATIVE_QUANTIZED : MatMulKernelType::NATIVE_FP; } } // namespace using namespace arm_compute::opencl::kernels; diff --git a/src/runtime/CL/CLMemoryRegion.cpp b/src/runtime/CL/CLMemoryRegion.cpp index c9ddf9b85c..835958b816 100644 --- a/src/runtime/CL/CLMemoryRegion.cpp +++ b/src/runtime/CL/CLMemoryRegion.cpp @@ -26,8 +26,6 @@ #include "arm_compute/core/Error.h" #include "arm_compute/runtime/CL/CLScheduler.h" -#include "src/common/utils/Log.h" - namespace arm_compute { ICLMemoryRegion::ICLMemoryRegion(size_t size) @@ -74,14 +72,7 @@ CLBufferMemoryRegion::~CLBufferMemoryRegion() // Flush the command queue to ensure all commands that may use this memory buffer are scheduled to be finished before // this buffer is freed // Do not call finish as it is a blocking call which affects the performance - try - { - CLScheduler::get().queue().flush(); - } - catch (const std::exception &e) - { - ARM_COMPUTE_LOG_ERROR_ACL(e.what()); - } + CLScheduler::get().queue().flush(); } void *CLBufferMemoryRegion::ptr() -- cgit v1.2.1