CMakeLists.txt 5.5 KB
Newer Older
1
if ((NOT LITE_ON_MODEL_OPTIMIZE_TOOL) AND (NOT LITE_WITH_OPENCL))
Y
Yan Chunwei 已提交
2 3 4
    return ()
endif()

5
set(cl_kernel_deps op_params cl_runtime cl_context cl_wrapper cl_target_wrapper cl_image_converter)
Y
Yan Chunwei 已提交
6

7 8 9
add_kernel(fc_opencl OPENCL basic SRCS fc_compute.cc DEPS ${cl_kernel_deps})
add_kernel(mul_opencl OPENCL basic SRCS mul_compute.cc DEPS ${cl_kernel_deps})
add_kernel(elementwise_add_opencl OPENCL basic SRCS elementwise_add_compute.cc DEPS ${cl_kernel_deps})
10
add_kernel(elementwise_mul_opencl OPENCL basic SRCS elementwise_mul_compute.cc DEPS ${cl_kernel_deps})
11
add_kernel(fusion_elementwise_add_activation_opencl
12 13
           OPENCL basic SRCS fusion_elementwise_add_activation_compute.cc
           DEPS elementwise_add_opencl ${cl_kernel_deps})
14 15 16
add_kernel(pool_opencl OPENCL basic SRCS pool_compute.cc DEPS ${cl_kernel_deps})
add_kernel(io_copy_compute_opencl OPENCL basic SRCS io_copy_compute.cc DEPS ${tensor_lite} ${cl_kernel_deps})
add_kernel(relu_opencl OPENCL basic SRCS relu_compute.cc DEPS ${cl_kernel_deps})
17
add_kernel(sigmoid_opencl OPENCL basic SRCS sigmoid_compute.cc DEPS ${cl_kernel_deps})
18
add_kernel(depthwise_conv2d_opencl OPENCL basic SRCS depthwise_conv2d_compute.cc DEPS ${cl_kernel_deps})
19
#add_kernel(conv2d_1x1_opencl OPENCL basic SRCS conv2d_1x1_compute.cc DEPS ${cl_kernel_deps})
X
xiebaiyuan 已提交
20
add_kernel(reshape_opencl OPENCL basic SRCS reshape_compute.cc DEPS ${cl_kernel_deps})
21
add_kernel(conv_opencl OPENCL basic SRCS conv_compute.cc DEPS ${cl_kernel_deps} cl_image_converter)
22
add_kernel(layout_opencl OPENCL basic SRCS layout_compute.cc DEPS ${cl_kernel_deps})
23
add_kernel(concat_opencl OPENCL basic SRCS concat_compute.cc DEPS ${cl_kernel_deps})
24
add_kernel(nearest_interp_opencl OPENCL basic SRCS nearest_interp_compute.cc DEPS ${cl_kernel_deps})
25
add_kernel(scale_opencl OPENCL basic SRCS scale_compute.cc DEPS ${cl_kernel_deps})
Y
Yan Chunwei 已提交
26 27

lite_cc_test(test_elementwise_add_opencl SRCS elementwise_add_compute_test.cc
28 29 30 31 32 33
             DEPS elementwise_add_opencl fusion_elementwise_add_activation_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

lite_cc_test(test_elementwise_mul_opencl SRCS elementwise_mul_compute_test.cc
             DEPS elementwise_mul_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
34 35

lite_cc_test(test_pool_opencl SRCS pool_compute_test.cc
36 37
             DEPS pool_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
38 39

lite_cc_test(test_fc_opencl SRCS fc_compute_test.cc
40 41
             DEPS fc_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
42

43 44 45 46
# TODO(ysh329): comment for buffer-impl mul
#lite_cc_test(test_mul_opencl SRCS mul_compute_test.cc
#        DEPS mul_opencl op_registry program context
#        ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
47 48

lite_cc_test(test_io_copy_compute_opencl SRCS io_copy_compute_test.cc
49 50
             DEPS io_copy_compute_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
51

52
#TODO(ysh329): comment buffer-impl relu
53
lite_cc_test(test_relu_opencl SRCS relu_compute_test.cc
54 55
             DEPS relu_opencl layout_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
56

57 58 59 60
lite_cc_test(test_sigmoid_opencl SRCS sigmoid_compute_test.cc
        DEPS sigmoid_opencl layout_opencl op_registry program context
        ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

Y
Yan Chunwei 已提交
61
lite_cc_test(test_depthwise_conv2d_opencl SRCS depthwise_conv2d_compute_test.cc
62 63
             DEPS depthwise_conv2d_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
64

65
lite_cc_test(test_depthwise_conv2d_basic_opencl SRCS depthwise_conv2d_basic_compute_test.cc
66 67
             DEPS depthwise_conv2d_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
68

69
#lite_cc_test(test_conv2d_1x1_opencl SRCS conv2d_1x1_compute_test.cc
70 71
#             DEPS conv2d_1x1_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
72

X
xiebaiyuan 已提交
73
lite_cc_test(test_reshape_opencl SRCS reshape_compute_test.cc
74 75
             DEPS reshape_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
76

Y
Yan Chunwei 已提交
77
lite_cc_test(test_conv_opencl SRCS conv_compute_test.cc
78 79
             DEPS conv_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
80

81 82 83 84
lite_cc_test(test_conv_image2d_opencl SRCS conv_image2d_compute_test.cc
        DEPS conv_opencl op_registry program context cl_image_converter
        ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

85
lite_cc_test(test_layout_opencl SRCS layout_compute_test.cc
86 87
        DEPS layout_opencl op_registry program context cl_image_converter
        ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
88 89 90 91 92

lite_cc_test(test_concat_opencl SRCS concat_compute_test.cc
        DEPS concat_opencl layout_opencl op_registry program context
         ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
         
93 94 95
lite_cc_test(test_nearest_interp_opencl SRCS nearest_interp_compute_test.cc
        DEPS nearest_interp_opencl layout_opencl op_registry program context cl_image_converter
        ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
96 97 98 99

lite_cc_test(test_scale_opencl SRCS scale_compute_test.cc
             DEPS scale_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)