From 8fa1879592e8cf93b88b46d170866e3d52517f96 Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Wed, 4 Mar 2020 20:51:45 +0800 Subject: [PATCH] [opencl lib] Fix opencl android demo (#3082) * test=develop * test=develop --- lite/kernels/opencl/conv_image_compute.cc | 30 +++++++++++----------- lite/kernels/opencl/pool_image_compute.cc | 4 +-- lite/kernels/opencl/scale_image_compute.cc | 4 +-- lite/tools/build.sh | 3 ++- lite/tools/ci_build.sh | 2 +- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lite/kernels/opencl/conv_image_compute.cc b/lite/kernels/opencl/conv_image_compute.cc index 1a718c2866..c1e078291a 100644 --- a/lite/kernels/opencl/conv_image_compute.cc +++ b/lite/kernels/opencl/conv_image_compute.cc @@ -263,9 +263,9 @@ void ConvImageCompute::Conv2d1x1() { << input_image_shape["height"]; VLOG(4) << "input_c_block: " << input_c_block; VLOG(4) << "input_c: " << input_c; - VLOG(4) << "input_image: " << input_image; + // VLOG(4) << "input_image: " << input_image; VLOG(4) << "filter_dims: " << filter_dims; - VLOG(4) << "filter_image: " << filter_image; + // VLOG(4) << "filter_image: " << filter_image; VLOG(4) << "output_dims: " << output_dims; VLOG(4) << "out_image_shape: " << out_image_shape["width"] << ", " << out_image_shape["height"]; @@ -352,7 +352,7 @@ void ConvImageCompute::Conv2d1x1() { static_cast(maped_w), static_cast(default_work_size.data()[2])}; - VLOG(4) << "out_image: " << out_image; + // VLOG(4) << "out_image: " << out_image; VLOG(4) << "global_work_size[3D]: {" << global_work_size[0] << "," << global_work_size[1] << "," << global_work_size[2] << "}"; @@ -434,10 +434,10 @@ void ConvImageCompute::Conv2d3x3() { << input_image_shape["height"]; VLOG(4) << "input_c_block: " << input_c_block; VLOG(4) << "input_c: " << input_c; - VLOG(4) << "input_image: " << input_image; + // VLOG(4) << "input_image: " << input_image; VLOG(4) << "input_dims: " << input_dims; VLOG(4) << "filter_dims: " << filter_dims; - VLOG(4) << "filter_image: " << filter_image; + // VLOG(4) << "filter_image: " << filter_image; VLOG(4) << "output_dims: " << output_dims; VLOG(4) << "out_image_shape: " << out_image_shape["width"] << ", " << out_image_shape["height"]; @@ -529,7 +529,7 @@ void ConvImageCompute::Conv2d3x3() { static_cast(default_work_size.data()[1]), static_cast(default_work_size.data()[2])}; - VLOG(4) << "out_image: " << out_image; + // VLOG(4) << "out_image: " << out_image; VLOG(4) << "global_work_size[3D]: {" << global_work_size[0] << "," << global_work_size[1] << "," << global_work_size[2] << "}"; @@ -591,10 +591,10 @@ void ConvImageCompute::Conv2d5x5() { << input_image_shape["height"]; VLOG(4) << "input_c_block: " << input_c_block; VLOG(4) << "input_c: " << input_c; - VLOG(4) << "input_image: " << input_image; + // VLOG(4) << "input_image: " << input_image; VLOG(4) << "input_dims: " << input_dims; VLOG(4) << "filter_dims: " << filter_dims; - VLOG(4) << "filter_image: " << filter_image; + // VLOG(4) << "filter_image: " << filter_image; VLOG(4) << "output_dims: " << output_dims; VLOG(4) << "out_image_shape: " << out_image_shape["width"] << ", " << out_image_shape["height"]; @@ -674,7 +674,7 @@ void ConvImageCompute::Conv2d5x5() { static_cast(default_work_size.data()[1]), static_cast(default_work_size.data()[2])}; - VLOG(4) << "out_image: " << out_image; + // VLOG(4) << "out_image: " << out_image; VLOG(4) << "global_work_size[3D]: {" << global_work_size[0] << "," << global_work_size[1] << "," << global_work_size[2] << "}"; @@ -736,10 +736,10 @@ void ConvImageCompute::Conv2d7x7() { << input_image_shape["height"]; VLOG(4) << "input_c_block: " << input_c_block; VLOG(4) << "input_c: " << input_c; - VLOG(4) << "input_image: " << input_image; + // VLOG(4) << "input_image: " << input_image; VLOG(4) << "input_dims: " << input_dims; VLOG(4) << "filter_dims: " << filter_dims; - VLOG(4) << "filter_image: " << filter_image; + // VLOG(4) << "filter_image: " << filter_image; VLOG(4) << "output_dims: " << output_dims; VLOG(4) << "out_image_shape: " << out_image_shape["width"] << ", " << out_image_shape["height"]; @@ -819,7 +819,7 @@ void ConvImageCompute::Conv2d7x7() { static_cast(default_work_size.data()[1]), static_cast(default_work_size.data()[2])}; - VLOG(4) << "out_image: " << out_image; + // VLOG(4) << "out_image: " << out_image; VLOG(4) << "global_work_size[3D]: {" << global_work_size[0] << "," << global_work_size[1] << "," << global_work_size[2] << "}"; @@ -1051,9 +1051,9 @@ void ConvImageCompute::DepthwiseConv2d() { << input_image_shape["height"]; VLOG(4) << "input_c_block: " << input_c_block; VLOG(4) << "input_c: " << input_c; - VLOG(4) << "input_image: " << input_image; + // VLOG(4) << "input_image: " << input_image; VLOG(4) << "filter_dims: " << filter_dims; - VLOG(4) << "filter_image: " << filter_image; + // VLOG(4) << "filter_image: " << filter_image; VLOG(4) << "output_dims: " << output_dims; VLOG(4) << "out_image_shape: " << out_image_shape["width"] << ", " << out_image_shape["height"]; @@ -1139,7 +1139,7 @@ void ConvImageCompute::DepthwiseConv2d() { static_cast(default_work_size.data()[1]), static_cast(default_work_size.data()[2])}; - VLOG(4) << "out_image: " << out_image; + // VLOG(4) << "out_image: " << out_image; VLOG(4) << "global_work_size[3D]: {" << global_work_size[0] << "," << global_work_size[1] << "," << global_work_size[2] << "}"; diff --git a/lite/kernels/opencl/pool_image_compute.cc b/lite/kernels/opencl/pool_image_compute.cc index 10e5cdccff..cac1393a13 100644 --- a/lite/kernels/opencl/pool_image_compute.cc +++ b/lite/kernels/opencl/pool_image_compute.cc @@ -91,14 +91,14 @@ class PoolComputeImage2D : public KernelLitedata(); - VLOG(4) << "x_image" << x_img; + // VLOG(4) << "x_image" << x_img; auto out_image_shape = InitImageDimInfoWith(out_dims); VLOG(4) << "out_image_shape = " << out_image_shape["width"] << " " << out_image_shape["height"]; auto* out_img = param.output->mutable_data( out_image_shape["width"], out_image_shape["height"]); - VLOG(4) << "out_image" << out_img; + // VLOG(4) << "out_image" << out_img; STL::stringstream kernel_key; kernel_key << kernel_func_name_ << build_options_; diff --git a/lite/kernels/opencl/scale_image_compute.cc b/lite/kernels/opencl/scale_image_compute.cc index 0387314f4f..fb2f016b7b 100644 --- a/lite/kernels/opencl/scale_image_compute.cc +++ b/lite/kernels/opencl/scale_image_compute.cc @@ -48,13 +48,13 @@ class ScaleComputeImage2D : public KernelLitemutable_data( out_image_shape["width"], out_image_shape["height"]); - LOG(INFO) << "out_image" << out_img; + // LOG(INFO) << "out_image" << out_img; auto& context = ctx_->As(); CHECK(context.cl_context() != nullptr); diff --git a/lite/tools/build.sh b/lite/tools/build.sh index 1a2e668d4c..eabd430318 100755 --- a/lite/tools/build.sh +++ b/lite/tools/build.sh @@ -158,7 +158,8 @@ function make_opencl { -DLITE_ON_TINY_PUBLISH=ON \ -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \ -DWITH_TESTING=OFF \ - -DLITE_BUILD_EXTRA=ON \ + -DLITE_BUILD_EXTRA=$BUILD_EXTRA \ + -DLITE_WITH_CV=$BUILD_CV \ -DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3 make opencl_clhpp -j$NUM_PROC diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 0dc83036a4..af7e69ed9d 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -194,7 +194,7 @@ function build_opencl { build $TESTS_FILE # test publish inference lib - make publish_inference + make publish_inference -j$NUM_CORES_FOR_COMPILE } # This method is only called in CI. -- GitLab