Skip to content

Commit

Permalink
[OpenCL][Compile] Remove online download opencl headers (PaddlePaddle…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyang-star authored Jul 21, 2021
1 parent 19ec24d commit 0afe172
Show file tree
Hide file tree
Showing 28 changed files with 28,199 additions and 102 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ repos:
- id: detect-private-key
files: (?!.*third_party)^.*$|(?!.*book)^.*$
- id: end-of-file-fixer
exclude: ^(third-party/)
- repo: local
hooks:
- id: clang-format-with-version-check
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ endif()

# for opencl
if (LITE_WITH_OPENCL)
include(external/opencl-headers)
include(external/opencl-clhpp)
include_directories("${PADDLE_SOURCE_DIR}/third-party/opencl/include")
endif()

# for mobile
Expand Down
36 changes: 0 additions & 36 deletions cmake/external/opencl-clhpp.cmake

This file was deleted.

33 changes: 0 additions & 33 deletions cmake/external/opencl-headers.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions lite/backends/opencl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ lite_cc_library(cl_image SRCS cl_image.cc DEPS tensor cl_image_converter cl_runt
lite_cc_library(cl_caller SRCS cl_caller.cc DEPS cl_context cl_image)
lite_cc_library(cl_target_wrapper SRCS target_wrapper.cc DEPS cl_runtime)
lite_cc_test(test_cl_functions SRCS cl_functions_test.cc DEPS cl_context cl_image cl_caller cl_wrapper cl_target_wrapper)

add_dependencies(cl_wrapper opencl_clhpp)
2 changes: 1 addition & 1 deletion lite/backends/opencl/cl_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
#define CL_HPP_TARGET_OPENCL_VERSION 110
#define CL_HPP_MINIMUM_OPENCL_VERSION 110

#include <CL/cl2.hpp>
#include "CL/cl2.hpp"
4 changes: 0 additions & 4 deletions lite/tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ function make_opencl {
-DLITE_WITH_CV=$BUILD_CV \
-DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3

make opencl_clhpp -j$NUM_PROC
make publish_inference -j$NUM_PROC
}

Expand Down Expand Up @@ -507,9 +506,6 @@ function make_x86 {
-DPY_VERSION=$PY_VERSION \
$PYTHON_EXECUTABLE_OPTION

if [ ${WITH_OPENCL} == "ON" ]; then
make opencl_clhpp -j$NUM_PROC
fi
make publish_inference -j$NUM_PROC
cd -
}
Expand Down
10 changes: 1 addition & 9 deletions lite/tools/build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,7 @@ function make_tiny_publish_so {
${cmake_mutable_options} \
-DLITE_ON_TINY_PUBLISH=ON

# Step4. Compile libs: cxx_lib, java_lib, opencl_lib
if [ "${WITH_OPENCL}" == "ON" ]; then
make opencl_clhpp -j$NUM_PROC
fi
# Step4. Compile libs: cxx_lib, java_lib
make publish_inference -j$NUM_PROC
cd - > /dev/null
}
Expand Down Expand Up @@ -301,11 +298,6 @@ function make_full_publish_so {
${cmake_api_level_options} \
${cmake_mutable_options}

# todo: third_party of opencl should be moved into git submodule and cmake later
if [ "${WITH_OPENCL}" == "ON" ]; then
make opencl_clhpp -j$NUM_PROC
fi

make publish_inference -j$NUM_PROC
cd - > /dev/null
}
Expand Down
4 changes: 0 additions & 4 deletions lite/tools/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ function make_publish_so {
${CMAKE_COMMON_OPTIONS} \
${cmake_mutable_options}

if [ "${WITH_OPENCL}" = "ON" ]; then
make opencl_clhpp -j$NUM_PROC
fi

make publish_inference -j$NUM_PROC
cd - > /dev/null
}
Expand Down
3 changes: 0 additions & 3 deletions lite/tools/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ function make_x86 {
-DPY_VERSION=$PY_VERSION \
$PYTHON_EXECUTABLE_OPTION

if [ ${WITH_OPENCL} == "ON" ]; then
make opencl_clhpp -j$NUM_PROC
fi
make publish_inference -j$NUM_PROC
cd -
}
Expand Down
8 changes: 1 addition & 7 deletions lite/tools/build_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,9 @@ if "%BUILD_FOR_CI%"=="ON" (
msbuild /m:%cores% /p:Configuration=Release lite\api\opt.vcxproj
) else if "%BUILD_PLATFORM%"=="x64" (
call "%vcvarsall_dir%" amd64
if "%WITH_OPENCL%"=="ON" (
msbuild /maxcpucount:%cores% /p:Configuration=Release lite\opencl_clhpp.vcxproj
)
msbuild /maxcpucount:%cores% /p:Configuration=Release lite\publish_inference.vcxproj
) else (
call "%vcvarsall_dir%" x86
if "%WITH_OPENCL%"=="ON" (
msbuild /maxcpucount:%cores% /p:Configuration=Release lite\opencl_clhpp.vcxproj
)
msbuild /maxcpucount:%cores% /p:Configuration=Release lite\publish_inference.vcxproj
)
goto:eof
Expand Down Expand Up @@ -277,7 +271,7 @@ goto:eof
goto:eof

:set_vcvarsall_dir
SET /P vcvarsall_dir="Please input the path of visual studio command Prompt, such as C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat =======>"
SET /P vcvarsall_dir="Please input the path of visual studio command Prompt, such as %vcvarsall_dir% =======>"
set tmp_var=!vcvarsall_dir!
call:remove_space
set vcvarsall_dir=!tmp_var!
Expand Down
1 change: 0 additions & 1 deletion lite/tools/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ function build_opencl {
prepare_opencl_source_code $cur_dir $build_dir

cmake_opencl ${os} ${abi} ${lang}
make opencl_clhpp -j$NUM_CORES_FOR_COMPILE
build $TESTS_FILE
}

Expand Down
Loading

0 comments on commit 0afe172

Please sign in to comment.