CMakeLists.txt 7.2 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 10 11 12
#####################
# image kernel      #
#####################
# basic
add_kernel(elementwise_add_opencl OPENCL basic SRCS elementwise_add_image_compute.cc DEPS ${cl_kernel_deps})
add_kernel(elementwise_mul_opencl OPENCL basic SRCS elementwise_mul_image_compute.cc DEPS ${cl_kernel_deps})
13
add_kernel(fusion_elementwise_add_activation_opencl
14
           OPENCL basic SRCS fusion_elementwise_add_activation_image_compute.cc
15
           DEPS elementwise_add_opencl ${cl_kernel_deps})
16 17 18 19 20

add_kernel(pool_opencl OPENCL basic SRCS pool_image_compute.cc DEPS ${cl_kernel_deps})
add_kernel(activation_opencl OPENCL basic SRCS activation_image_compute.cc DEPS ${cl_kernel_deps})
add_kernel(reshape_opencl OPENCL basic SRCS reshape_image_compute.cc DEPS ${cl_kernel_deps})
add_kernel(conv_opencl OPENCL basic SRCS conv_image_compute.cc DEPS ${cl_kernel_deps})
21
add_kernel(layout_opencl OPENCL basic SRCS layout_image_compute.cc DEPS ${cl_kernel_deps})
22 23 24
add_kernel(concat_opencl OPENCL basic SRCS concat_image_compute.cc DEPS ${cl_kernel_deps})
add_kernel(nearest_interp_opencl OPENCL basic SRCS nearest_interp_image_compute.cc DEPS ${cl_kernel_deps})
add_kernel(scale_opencl OPENCL basic SRCS scale_image_compute.cc DEPS ${cl_kernel_deps})
25
add_kernel(grid_sampler_opencl OPENCL basic SRCS grid_sampler_image_compute.cc DEPS ${cl_kernel_deps})
Y
Yan Chunwei 已提交
26

27 28 29 30 31 32 33 34 35 36 37
# extra
# wait to add ...




######################
# image kernel test  #
######################
lite_cc_test(test_activation_image_opencl SRCS activation_image_compute_test.cc
             DEPS activation_opencl layout_opencl op_registry program context
38 39
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

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

44 45
lite_cc_test(test_depthwise_conv2d_image_opencl SRCS depthwise_conv2d_image_compute_test.cc
             DEPS conv_opencl op_registry program context
46
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
47

48 49 50 51 52 53
lite_cc_test(test_nearest_interp_image_opencl SRCS nearest_interp_image_compute_test.cc
             DEPS nearest_interp_opencl layout_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

lite_cc_test(test_pool_image_opencl SRCS pool_image_compute_test.cc
             DEPS pool_opencl op_registry program context
54
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
55

56 57 58
lite_cc_test(test_scale_image_opencl SRCS scale_image_compute_test.cc
             DEPS scale_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
59

60 61
lite_cc_test(test_reshape_image_opencl SRCS reshape_image_compute_test.cc
             DEPS reshape_opencl op_registry program context
62
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
63

64 65
lite_cc_test(test_concat_image_opencl SRCS concat_image_compute_test.cc
             DEPS concat_opencl layout_opencl op_registry program context
66
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
67

68 69 70
lite_cc_test(test_elementwise_mul_image_opencl SRCS elementwise_mul_image_compute_test.cc
             DEPS elementwise_mul_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
71

72
lite_cc_test(test_layout_image_opencl SRCS layout_image_compute_test.cc
73
             DEPS layout_opencl op_registry program context
74
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
Y
Yan Chunwei 已提交
75

76 77
lite_cc_test(test_elementwise_add_image_opencl SRCS elementwise_add_image_compute_test.cc
             DEPS elementwise_add_opencl fusion_elementwise_add_activation_opencl op_registry program context
78
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
79

80 81 82
lite_cc_test(test_grid_sampler_image_opencl SRCS grid_sampler_image_compute_test.cc
             DEPS grid_sampler_opencl op_registry program context
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130

######################
# buffer kernel      #
######################
# basic
#add_kernel(activation_opencl OPENCL basic SRCS activation_buffer_compute.cc DEPS ${cl_kernel_deps})
#add_kernel(conv_opencl OPENCL basic SRCS conv_buffer_compute.cc DEPS ${cl_kernel_deps})
#add_kernel(depthwise_conv2d_opencl OPENCL basic SRCS depthwise_conv2d_buffer_compute.cc DEPS ${cl_kernel_deps})
#add_kernel(pool_opencl OPENCL basic SRCS pool_buffer_compute.cc DEPS ${cl_kernel_deps})
#add_kernel(concat_opencl OPENCL basic SRCS concat_buffer_compute.cc DEPS ${cl_kernel_deps})
add_kernel(fc_opencl OPENCL basic SRCS fc_buffer_compute.cc DEPS ${cl_kernel_deps})
add_kernel(mul_opencl OPENCL basic SRCS mul_buffer_compute.cc DEPS ${cl_kernel_deps})
#add_kernel(elementwise_add_opencl OPENCL basic SRCS elementwise_add_buffer_compute.cc DEPS ${cl_kernel_deps})
#add_kernel(fusion_elementwise_add_activation_opencl
#           OPENCL basic SRCS fusion_elementwise_add_activation_buffer_compute.cc
#           DEPS elementwise_add_opencl ${cl_kernel_deps})
add_kernel(io_copy_opencl OPENCL basic SRCS io_copy_buffer_compute.cc DEPS ${tensor_lite} ${cl_kernel_deps})

# extra
# wait to add ...



######################
# buffer kernel test #
######################
#lite_cc_test(test_activation_buffer_opencl SRCS activation_buffer_compute_test.cc
#             DEPS activation_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

#lite_cc_test(test_conv_buffer_opencl SRCS conv_buffer_compute_test.cc
#             DEPS conv_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

#lite_cc_test(test_depthwise_conv2d_buffer_opencl SRCS depthwise_conv2d_buffer_compute_test.cc
#             DEPS depthwise_conv2d_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

#lite_cc_test(test_pool_buffer_opencl SRCS pool_buffer_compute_test.cc
#             DEPS pool_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

#lite_cc_test(test_concat_buffer_opencl SRCS concat_buffer_compute_test.cc
#             DEPS concat_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)

lite_cc_test(test_fc_buffer_opencl SRCS fc_buffer_compute_test.cc
             DEPS fc_opencl op_registry program context
131
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
132

133 134
lite_cc_test(test_mul_buffer_opencl SRCS mul_buffer_compute_test.cc
             DEPS mul_opencl op_registry program context
135
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
136

137
#lite_cc_test(test_elementwise_add_buffer_opencl SRCS elementwise_add__buffer_compute_test.cc
138 139
#             DEPS elementwise_add_opencl op_registry program context
#             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)
140

141 142
lite_cc_test(test_io_copy_buffer_opencl SRCS io_copy_buffer_compute_test.cc
             DEPS io_copy_opencl op_registry program context
143
             ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/backends/opencl)