Skip to content

Commit 41dbef9

Browse files
[OpenCL][Compile] Remove online download opencl headers (#6533)
* [OpenCL][Compile] Remove online download opencl headers (#6516) * test=develop
1 parent 51fcbb6 commit 41dbef9

28 files changed

+28203
-106
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repos:
1919
- id: detect-private-key
2020
files: (?!.*third_party)^.*$|(?!.*book)^.*$
2121
- id: end-of-file-fixer
22+
exclude: ^(third-party/)
2223
- repo: local
2324
hooks:
2425
- id: clang-format-with-version-check

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ endif()
205205

206206
# for opencl
207207
if (LITE_WITH_OPENCL)
208-
include(external/opencl-headers)
209-
include(external/opencl-clhpp)
208+
include_directories("${PADDLE_SOURCE_DIR}/third-party/opencl/include")
210209
endif()
211210

212211
# for mobile

cmake/external/opencl-clhpp.cmake

Lines changed: 0 additions & 36 deletions
This file was deleted.

cmake/external/opencl-headers.cmake

Lines changed: 0 additions & 33 deletions
This file was deleted.

lite/backends/opencl/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,3 @@ lite_cc_library(cl_image SRCS cl_image.cc DEPS tensor cl_image_converter cl_runt
1515
lite_cc_library(cl_caller SRCS cl_caller.cc DEPS cl_context cl_image)
1616
lite_cc_library(cl_target_wrapper SRCS target_wrapper.cc DEPS cl_runtime)
1717
lite_cc_test(test_cl_functions SRCS cl_functions_test.cc DEPS cl_context cl_image cl_caller cl_wrapper cl_target_wrapper)
18-
19-
add_dependencies(cl_wrapper opencl_clhpp)

lite/backends/opencl/cl_include.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
#define CL_HPP_TARGET_OPENCL_VERSION 110
1919
#define CL_HPP_MINIMUM_OPENCL_VERSION 110
2020

21-
#include <CL/cl2.hpp>
21+
#include "CL/cl2.hpp"

lite/tools/build.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ function make_opencl {
242242
-DLITE_WITH_CV=$BUILD_CV \
243243
-DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3
244244

245-
make opencl_clhpp -j$NUM_PROC
246245
make publish_inference -j$NUM_PROC
247246
}
248247

@@ -495,9 +494,6 @@ function make_x86 {
495494
-DPY_VERSION=$PY_VERSION \
496495
$PYTHON_EXECUTABLE_OPTION
497496

498-
if [ ${WITH_OPENCL} == "ON" ]; then
499-
make opencl_clhpp -j$NUM_PROC
500-
fi
501497
make publish_inference -j$NUM_PROC
502498
cd -
503499
}

lite/tools/build_android.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ function make_tiny_publish_so {
219219
${cmake_mutable_options} \
220220
-DLITE_ON_TINY_PUBLISH=ON
221221

222-
# Step4. Compile libs: cxx_lib, java_lib, opencl_lib
223-
if [ "${WITH_OPENCL}" == "ON" ]; then
224-
make opencl_clhpp -j$NUM_PROC
225-
fi
222+
# Step4. Compile libs: cxx_lib, java_lib
226223
make publish_inference -j$NUM_PROC
227224
cd - > /dev/null
228225
}
@@ -285,11 +282,6 @@ function make_full_publish_so {
285282
${cmake_api_level_options} \
286283
${cmake_mutable_options}
287284

288-
# todo: third_party of opencl should be moved into git submodule and cmake later
289-
if [ "${WITH_OPENCL}" == "ON" ]; then
290-
make opencl_clhpp -j$NUM_PROC
291-
fi
292-
293285
make publish_inference -j$NUM_PROC
294286
cd - > /dev/null
295287
}

lite/tools/build_linux.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WITH_STATIC_LIB=OFF
1919
WITH_CV=OFF
2020
# controls whether to print log information, default is ON.
2121
WITH_LOG=ON
22-
# controls whether to throw the exception when error occurs, default is OFF
22+
# controls whether to throw the exception when error occurs, default is OFF
2323
WITH_EXCEPTION=OFF
2424
# options of striping lib according to input model.
2525
WITH_STRIP=OFF
@@ -31,13 +31,13 @@ WITH_ROCKCHIP_NPU=OFF
3131
ROCKCHIP_NPU_SDK_ROOT="$(pwd)/rknpu_ddk" # Download RKNPU SDK from https://github.com/airockchip/rknpu_ddk.git
3232
# options of compiling imagination NNA lib
3333
WITH_IMAGINATION_NNA=OFF
34-
IMAGINATION_NNA_SDK_ROOT="$(pwd)/imagination_nna_sdk"
34+
IMAGINATION_NNA_SDK_ROOT="$(pwd)/imagination_nna_sdk"
3535
# options of compiling baidu XPU lib.
3636
WITH_BAIDU_XPU=OFF
3737
BAIDU_XPU_SDK_ROOT=""
3838
# options of compiling intel fpga.
3939
WITH_INTEL_FPGA=OFF
40-
INTEL_FPGA_SDK_ROOT="$(pwd)/intel_fpga_sdk"
40+
INTEL_FPGA_SDK_ROOT="$(pwd)/intel_fpga_sdk"
4141
# options of adding training ops
4242
WITH_TRAIN=OFF
4343
# num of threads used during compiling..
@@ -125,7 +125,7 @@ function prepare_opencl_source_code {
125125
OPENCL_KERNELS_PATH=$root_dir/lite/backends/opencl/cl_kernel
126126
mkdir -p ${GEN_CODE_PATH_OPENCL}
127127
touch $GEN_CODE_PATH_OPENCL/opencl_kernels_source.cc
128-
python $root_dir/lite/tools/cmake_tools/gen_opencl_code.py $OPENCL_KERNELS_PATH $GEN_CODE_PATH_OPENCL/opencl_kernels_source.cc
128+
python $root_dir/lite/tools/cmake_tools/gen_opencl_code.py $OPENCL_KERNELS_PATH $GEN_CODE_PATH_OPENCL/opencl_kernels_source.cc
129129
}
130130

131131
# 3.3 prepare third_party libraries for compiling
@@ -201,10 +201,6 @@ function make_tiny_publish_so {
201201
${cmake_mutable_options} \
202202
-DLITE_ON_TINY_PUBLISH=$is_tiny
203203

204-
if [ "${WITH_OPENCL}" = "ON" ]; then
205-
make opencl_clhpp -j$NUM_PROC
206-
fi
207-
208204
make publish_inference -j$NUM_PROC
209205
cd - > /dev/null
210206
}

lite/tools/build_macos.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ function make_x86 {
216216
-DPY_VERSION=$PY_VERSION \
217217
$PYTHON_EXECUTABLE_OPTION
218218

219-
if [ ${WITH_OPENCL} == "ON" ]; then
220-
make opencl_clhpp -j$NUM_PROC
221-
fi
222219
make publish_inference -j$NUM_PROC
223220
cd -
224221
}

0 commit comments

Comments
 (0)