CMakeLists.txt 1.0 KB
Newer Older
Z
Zhen Wang 已提交
1
if (NOT LITE_WITH_OPENCL)
Z
Zhen Wang 已提交
2 3 4
    return()
endif()

Z
ZhenWang 已提交
5 6 7 8 9 10
if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
    add_library(opencl-lib SHARED IMPORTED)
    set_target_properties(opencl-lib
        PROPERTIES
        IMPORTED_LOCATION
        ${CMAKE_SOURCE_DIR}/opencl-lib/armeabi-v7a/libOpenCL.so)
Z
Zhen Wang 已提交
11

Z
ZhenWang 已提交
12 13 14 15 16 17 18 19 20
    cc_library(cl_tool SRCS cl_tool.cc)
    target_compile_options(cl_tool BEFORE PUBLIC -Wno-ignored-qualifiers)
    cc_library(cl_half SRCS cl_half.cc)
    target_compile_options(cl_half BEFORE PUBLIC -fno-strict-aliasing)
    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_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 SRCS cl_image.cc DEPS cl_half lite_tensor cl_image_converter cl_engine)
Z
ZhenWang 已提交
21
    lite_cc_test(test_cl_runtime SRCS cl_test.cc DEPS cl_engine cl_context)
Z
ZhenWang 已提交
22 23 24
    target_link_libraries(test_cl_runtime opencl-lib)
    add_dependencies(cl_tool opencl_clhpp)
endif()