提交 8f36c653 编写于 作者: Z ZhenWang

update build.sh

上级 53a3f12d
...@@ -2,19 +2,23 @@ if (NOT LITE_WITH_OPENCL) ...@@ -2,19 +2,23 @@ if (NOT LITE_WITH_OPENCL)
return() return()
endif() endif()
find_library(opencl-lib if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
NAMES OpenCL) add_library(opencl-lib SHARED IMPORTED)
message(STATUS "The OpenCL library path : ${opencl-lib}") set_target_properties(opencl-lib
PROPERTIES
IMPORTED_LOCATION
${CMAKE_SOURCE_DIR}/opencl-lib/armeabi-v7a/libOpenCL.so)
cc_library(cl_tool SRCS cl_tool.cc) cc_library(cl_tool SRCS cl_tool.cc)
target_compile_options(cl_tool BEFORE PUBLIC -Wno-ignored-qualifiers) target_compile_options(cl_tool BEFORE PUBLIC -Wno-ignored-qualifiers)
cc_library(cl_half SRCS cl_half.cc) cc_library(cl_half SRCS cl_half.cc)
target_compile_options(cl_half BEFORE PUBLIC -fno-strict-aliasing) target_compile_options(cl_half BEFORE PUBLIC -fno-strict-aliasing)
cc_library(cl_engine SRCS cl_engine.cc DEPS cl_tool) cc_library(cl_engine SRCS cl_engine.cc DEPS cl_tool)
cc_library(cl_context SRCS cl_context.cc DEPS cl_engine) cc_library(cl_context SRCS cl_context.cc DEPS cl_engine)
cc_library(cl_helper SRCS cl_helper.cc DEPS cl_context proto_desc) cc_library(cl_helper SRCS cl_helper.cc DEPS cl_context)
cc_library(cl_image_converter SRCS cl_image_converter.cc DEPS cl_half lite_tensor) cc_library(cl_image_converter SRCS cl_image_converter.cc DEPS cl_half lite_tensor)
cc_library(cl_image SRCS cl_image.cc DEPS cl_half lite_tensor cl_image_converter cl_engine) cc_library(cl_image SRCS cl_image.cc DEPS cl_half lite_tensor cl_image_converter cl_engine)
cc_test(test_cl_runtime SRCS cl_test.cc DEPS cl_engine cl_context) cc_test(test_cl_runtime SRCS cl_test.cc DEPS cl_engine cl_context)
target_link_libraries(test_cl_runtime ${opencl-lib}) target_link_libraries(test_cl_runtime opencl-lib)
add_dependencies(cl_tool opencl_clhpp) add_dependencies(cl_tool opencl_clhpp)
endif()
...@@ -26,6 +26,8 @@ function cmake_x86 { ...@@ -26,6 +26,8 @@ function cmake_x86 {
} }
function cmake_opencl { function cmake_opencl {
# $1: ARM_TARGET_OS in "android" , "armlinux"
# $2: ARM_TARGET_ARCH_ABI in "arm64-v8a", "armeabi-v7a" ,"armeabi-v7a-hf"
cmake .. \ cmake .. \
-DLITE_WITH_OPENCL=ON \ -DLITE_WITH_OPENCL=ON \
-DWITH_GPU=OFF \ -DWITH_GPU=OFF \
...@@ -438,7 +440,7 @@ function main { ...@@ -438,7 +440,7 @@ function main {
shift shift
;; ;;
cmake_opencl) cmake_opencl)
cmake_opencl cmake_opencl $ARM_OS $ARM_ABI
shift shift
;; ;;
cmake_cuda) cmake_cuda)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册