CMakeLists.txt 8.7 KB
Newer Older
1
if ((NOT LITE_ON_MODEL_OPTIMIZE_TOOL) AND (NOT LITE_WITH_PYTHON) 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
#####################
# image kernel      #
#####################
# basic
add_kernel(elementwise_add_opencl OPENCL basic SRCS elementwise_add_image_compute.cc DEPS ${cl_kernel_deps})
X
xiaogang 已提交
12
add_kernel(elementwise_sub_opencl OPENCL basic SRCS elementwise_sub_image_compute.cc DEPS ${cl_kernel_deps})
13
add_kernel(elementwise_mul_opencl OPENCL basic SRCS elementwise_mul_image_compute.cc DEPS ${cl_kernel_deps})
14
add_kernel(fusion_elementwise_add_activation_opencl
15
           OPENCL basic SRCS fusion_elementwise_add_activation_image_compute.cc
16
           DEPS elementwise_add_opencl ${cl_kernel_deps})
X
xiaogang 已提交
17 18 19
add_kernel(fusion_elementwise_sub_activation_opencl
           OPENCL basic SRCS fusion_elementwise_sub_activation_image_compute.cc
           DEPS elementwise_sub_opencl ${cl_kernel_deps})
20 21 22 23 24

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})
25
add_kernel(layout_opencl OPENCL basic SRCS layout_image_compute.cc DEPS ${cl_kernel_deps})
26 27 28
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})
29
add_kernel(grid_sampler_opencl OPENCL basic SRCS grid_sampler_image_compute.cc DEPS ${cl_kernel_deps})
H
HappyAngel 已提交
30
add_kernel(lrn_opencl OPENCL basic SRCS lrn_image_compute.cc DEPS ${cl_kernel_deps})
31
add_kernel(bilinear_interp_opencl OPENCL basic SRCS bilinear_interp_image_compute.cc DEPS ${cl_kernel_deps})
32
add_kernel(slice_opencl OPENCL basic SRCS slice_image_compute.cc DEPS ${cl_kernel_deps})
33
add_kernel(instance_norm_opencl OPENCL basic SRCS instance_norm_image_compute.cc DEPS ${cl_kernel_deps})
34
add_kernel(dropout_opencl OPENCL basic SRCS dropout_image_compute.cc DEPS ${cl_kernel_deps})
35
add_kernel(pad2d_opencl OPENCL basic SRCS pad2d_image_compute.cc DEPS ${cl_kernel_deps})
H
HappyAngel 已提交
36
add_kernel(box_coder_opencl OPENCL basic SRCS box_coder_image_compute.cc DEPS ${cl_kernel_deps})
37
add_kernel(pixel_shuffle_opencl OPENCL basic SRCS pixel_shuffle_image_compute.cc DEPS ${cl_kernel_deps})
38 39
add_kernel(expand_opencl OPENCL basic SRCS expand_image_compute.cc DEPS ${cl_kernel_deps})

40 41 42 43 44 45 46 47 48 49
# extra
# wait to add ...




######################
# image kernel test  #
######################
lite_cc_test(test_activation_image_opencl SRCS activation_image_compute_test.cc
50
             DEPS activation_opencl layout_opencl op_registry program context)
51

52
lite_cc_test(test_conv_image_opencl SRCS conv_image_compute_test.cc
53
             DEPS conv_opencl op_registry program context)
Y
Yan Chunwei 已提交
54

55
lite_cc_test(test_depthwise_conv2d_image_opencl SRCS depthwise_conv2d_image_compute_test.cc
56
             DEPS conv_opencl op_registry program context)
Y
Yan Chunwei 已提交
57

58
lite_cc_test(test_nearest_interp_image_opencl SRCS nearest_interp_image_compute_test.cc
59
             DEPS nearest_interp_opencl layout_opencl op_registry program context)
60 61

lite_cc_test(test_pool_image_opencl SRCS pool_image_compute_test.cc
62
             DEPS pool_opencl op_registry program context)
Y
Yan Chunwei 已提交
63

64
lite_cc_test(test_scale_image_opencl SRCS scale_image_compute_test.cc
65
             DEPS scale_opencl op_registry program context)
Y
Yan Chunwei 已提交
66

67
lite_cc_test(test_reshape_image_opencl SRCS reshape_image_compute_test.cc
68
             DEPS reshape_opencl op_registry program context)
Y
Yan Chunwei 已提交
69

70
lite_cc_test(test_concat_image_opencl SRCS concat_image_compute_test.cc
71
             DEPS concat_opencl layout_opencl op_registry program context)
Y
Yan Chunwei 已提交
72

73 74
#lite_cc_test(test_elementwise_mul_image_opencl SRCS elementwise_mul_image_compute_test.cc
#             DEPS elementwise_mul_opencl op_registry program context)
75

76
lite_cc_test(test_layout_image_opencl SRCS layout_image_compute_test.cc
77
             DEPS layout_opencl op_registry program context)
Y
Yan Chunwei 已提交
78

79 80 81
lite_cc_test(test_pixel_shuffle_image_opencl SRCS pixel_shuffle_image_compute_test.cc
             DEPS pixel_shuffle_opencl op_registry program context)

82 83 84
lite_cc_test(test_expand_image_opencl SRCS expand_image_compute_test.cc
             DEPS expand_opencl op_registry program context)

85
lite_cc_test(test_elementwise_add_image_opencl SRCS elementwise_add_image_compute_test.cc
86
             DEPS elementwise_add_opencl fusion_elementwise_add_activation_opencl op_registry program context)
X
xiaogang 已提交
87
lite_cc_test(test_elementwise_sub_image_opencl SRCS elementwise_sub_image_compute_test.cc
88
             DEPS elementwise_sub_opencl fusion_elementwise_sub_activation_opencl op_registry program context)
89

90
lite_cc_test(test_grid_sampler_image_opencl SRCS grid_sampler_image_compute_test.cc
91
             DEPS grid_sampler_opencl op_registry program context)
H
HappyAngel 已提交
92 93 94

lite_cc_test(test_lrn_image_opencl SRCS lrn_image_compute_test.cc
             DEPS lrn_opencl op_registry program context)
95 96 97
             
lite_cc_test(test_bilinear_interp_image_opencl SRCS bilinear_interp_image_compute_test.cc
	         DEPS bilinear_interp_opencl op_registry program context)
98 99 100
lite_cc_test(test_slice_image_opencl SRCS slice_image_compute_test.cc
	         DEPS slice_opencl op_registry program context)
             
101 102
	     #lite_cc_test(test_instance_norm_image_opencl SRCS instance_norm_image_compute_test.cc
	     #             DEPS instance_norm_opencl op_registry program context)
103 104

lite_cc_test(test_dropout_image_opencl SRCS dropout_image_compute_test.cc
105 106 107 108
                 DEPS dropout_opencl op_registry program context)  
                 
lite_cc_test(test_pad2d_image_opencl SRCS pad2d_image_compute_test.cc
                 DEPS pad2d_opencl layout_opencl op_registry program context)
H
HappyAngel 已提交
109 110 111 112

lite_cc_test(test_box_coder_image_opencl SRCS box_coder_image_compute_test.cc
                 DEPS box_coder_opencl op_registry program context)

113 114 115 116 117 118 119 120 121 122
######################
# 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})
123 124
# NOTE(ysh329): use fc as `mul`, and mul is not used.
#add_kernel(mul_opencl OPENCL basic SRCS mul_buffer_compute.cc DEPS ${cl_kernel_deps})
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
#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
140
#             DEPS activation_opencl op_registry program context)
141 142

#lite_cc_test(test_conv_buffer_opencl SRCS conv_buffer_compute_test.cc
143
#             DEPS conv_opencl op_registry program context)
144

145 146 147
#lite_cc_test(test_im2col_buffer_opencl SRCS im2col_buffer_test.cc
#             DEPS tensor cl_context cl_wrapper cl_target_wrapper)

148
#lite_cc_test(test_depthwise_conv2d_buffer_opencl SRCS depthwise_conv2d_buffer_compute_test.cc
149
#             DEPS depthwise_conv2d_opencl op_registry program context)
150 151

#lite_cc_test(test_pool_buffer_opencl SRCS pool_buffer_compute_test.cc
152
#             DEPS pool_opencl op_registry program context)
153 154

#lite_cc_test(test_concat_buffer_opencl SRCS concat_buffer_compute_test.cc
155
#             DEPS concat_opencl op_registry program context)
156 157

lite_cc_test(test_fc_buffer_opencl SRCS fc_buffer_compute_test.cc
158
             DEPS fc_opencl op_registry program context)
159

160 161
#lite_cc_test(test_mul_buffer_opencl SRCS mul_buffer_compute_test.cc
#             DEPS mul_opencl op_registry program context)
162

163
#lite_cc_test(test_elementwise_add_buffer_opencl SRCS elementwise_add__buffer_compute_test.cc
164
#             DEPS elementwise_add_opencl op_registry program context)
165

166
lite_cc_test(test_io_copy_buffer_opencl SRCS io_copy_buffer_compute_test.cc
167
             DEPS io_copy_opencl op_registry program context)