diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f956960fe0beed64592bbd115b9b434c5df3206..4458e219abb3fb0ebb67095626f824ee2faf8b56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0.0) option(USE_OPENMP "build with openmp support" ON) option(USE_EXCEPTION "build with exception" ON) -option(WITH_LOGGING "print logging for debug" ON) +option(WITH_LOGGING "print logging for debug" OFF) option(WITH_SYMBOL "build with all symbols" ON) # turn off if use jni or ios io option(WITH_PROFILE "print op profile for debug" OFF) option(WITH_TEST "build with unit tests" ON) diff --git a/src/io/ios_io/PaddleMobileCPU.mm b/src/io/ios_io/PaddleMobileCPU.mm index 743f78552ead54d95164ef199d449f6abcd15cca..f3a804e713c1e3caa5d806ceeca5b3b2d52ebce3 100644 --- a/src/io/ios_io/PaddleMobileCPU.mm +++ b/src/io/ios_io/PaddleMobileCPU.mm @@ -343,6 +343,7 @@ static std::mutex shared_mutex; [cpuResult toSetDim: ocDim]; [cpuResult toSetOutputSize: output_tensor->numel()]; + free(output); CFRelease(cfData); cfData = NULL; diff --git a/src/operators/kernel/arm/quantize_kernel.cpp b/src/operators/kernel/arm/quantize_kernel.cpp index c8af30a65590ef6dd3592da8709b94cba1ee60c6..79186be79e5b4207e9f6b2b221bc1a4160e4e67e 100644 --- a/src/operators/kernel/arm/quantize_kernel.cpp +++ b/src/operators/kernel/arm/quantize_kernel.cpp @@ -167,7 +167,7 @@ float find_abs_max(const Tensor *input) { max_abs = vmaxvq_f32(__max); #endif for (size_t i = 0; i < remain; ++i) { - max_abs = std::max(max_abs, fabs(x[i])); + max_abs = std::max(max_abs, static_cast(fabs(x[i]))); } return max_abs; } diff --git a/src/operators/kernel/logical_kernel.h b/src/operators/kernel/logical_kernel.h index 8c49669fa8f276b28e4d3b50db16937f766f70a1..b42ae27005212147a7a7467f974a8f10ca4af299 100644 --- a/src/operators/kernel/logical_kernel.h +++ b/src/operators/kernel/logical_kernel.h @@ -14,6 +14,8 @@ limitations under the License. */ #pragma once +#include + #include "framework/operator.h" #include "operators/op_param.h"