From 4194380a9598683479a1f56ed022b16570bd430e Mon Sep 17 00:00:00 2001 From: liuruilong Date: Thu, 11 Oct 2018 19:01:18 +0800 Subject: [PATCH] modified build.sh --- src/framework/cl/cl_scope.h | 2 +- src/operators/kernel/cl/cl_kernel/{common.h => cl_common.h} | 3 +-- src/operators/kernel/cl/cl_kernel/conv_kernel.inc.cl | 6 +----- tools/build.sh | 2 ++ 4 files changed, 5 insertions(+), 8 deletions(-) rename src/operators/kernel/cl/cl_kernel/{common.h => cl_common.h} (94%) diff --git a/src/framework/cl/cl_scope.h b/src/framework/cl/cl_scope.h index 15ca27fd7c..61082808b5 100644 --- a/src/framework/cl/cl_scope.h +++ b/src/framework/cl/cl_scope.h @@ -54,7 +54,7 @@ class CLScope { } auto program = - CLEngine::Instance()->CreateProgramWith(context_.get(), file_name); + CLEngine::Instance()->CreateProgramWith(context_.get(), "./cl_kernel/" + file_name); programs_[file_name] = std::move(program); status_ = clBuildProgram(program.get(), 0, 0, 0, 0, 0); diff --git a/src/operators/kernel/cl/cl_kernel/common.h b/src/operators/kernel/cl/cl_kernel/cl_common.h similarity index 94% rename from src/operators/kernel/cl/cl_kernel/common.h rename to src/operators/kernel/cl/cl_kernel/cl_common.h index 027255d9dc..c71967ccd6 100644 --- a/src/operators/kernel/cl/cl_kernel/common.h +++ b/src/operators/kernel/cl/cl_kernel/cl_common.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once; -/* +#pragma OPENCL EXTENSION cl_khr_fp16 : enable inline hafl4 activation(half4 in #ifdef PRELU @@ -32,4 +32,3 @@ inline hafl4 activation(half4 in return output; } -*/ diff --git a/src/operators/kernel/cl/cl_kernel/conv_kernel.inc.cl b/src/operators/kernel/cl/cl_kernel/conv_kernel.inc.cl index 04ceed8a6e..c0264fefdc 100644 --- a/src/operators/kernel/cl/cl_kernel/conv_kernel.inc.cl +++ b/src/operators/kernel/cl/cl_kernel/conv_kernel.inc.cl @@ -23,9 +23,7 @@ conv_add_bn_relu */ -/* - -#include "common.h" +#include "cl_common.h" __kernel void conv_1x1(__private const int global_size_dim0, __private const int global_size_dim1, @@ -305,5 +303,3 @@ __kernel void depth_conv_3x3(__private const int global_size_dim0, int2 output_pos(out_c * global_size_dim1 + out_w, out_nh); write_imageh(output_image, output_pos, output); } - -*/ diff --git a/tools/build.sh b/tools/build.sh index baa9fe1097..42ea9497a6 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -90,6 +90,8 @@ build_for_android() { fi cd "../build/release/${PLATFORM}" make -j 8 + mkdir ./build/cl_kernel + cp ../../../src/operators/kernel/cl/cl_kernel/* ./build/cl_kernel/ } build_for_ios() { -- GitLab