forked from Tencent/ncnn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
137 lines (122 loc) · 3.86 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
131
132
133
134
135
136
137
if(MSVC)
# warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
add_definitions(/wd4996)
endif()
macro(ncnn_add_test name)
add_executable(test_${name} test_${name}.cpp)
target_link_libraries(test_${name} PRIVATE ncnn)
add_test(NAME test_${name} COMMAND ${CMAKE_COMMAND} -DTEST_EXECUTABLE=$<TARGET_FILE:test_${name}> -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/run_test.cmake)
# add test to a virtual project group
set_property(TARGET test_${name} PROPERTY FOLDER "tests")
endmacro()
macro(ncnn_add_layer_test class)
string(TOLOWER ${class} name)
# enable if WITH_LAYER_xxx option ON
if(${WITH_LAYER_${name}})
ncnn_add_test(${name})
endif()
endmacro()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src/layer)
if(NCNN_PIXEL_AFFINE)
ncnn_add_test(mat_pixel_affine)
endif()
if(NCNN_PIXEL_DRAWING)
ncnn_add_test(mat_pixel_drawing)
endif()
if(NCNN_PIXEL_ROTATE)
ncnn_add_test(mat_pixel_rotate)
endif()
if(NCNN_PIXEL)
ncnn_add_test(mat_pixel_resize)
ncnn_add_test(mat_pixel)
ncnn_add_test(squeezenet)
endif()
ncnn_add_test(c_api)
ncnn_add_test(cpu)
if(NCNN_VULKAN)
ncnn_add_test(command)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
target_link_libraries(test_squeezenet PRIVATE nodefs.js)
endif()
ncnn_add_layer_test(AbsVal)
ncnn_add_layer_test(BatchNorm)
ncnn_add_layer_test(Bias)
ncnn_add_layer_test(BinaryOp)
ncnn_add_layer_test(BNLL)
ncnn_add_layer_test(Cast)
ncnn_add_layer_test(Clip)
ncnn_add_layer_test(Concat)
ncnn_add_layer_test(Convolution)
ncnn_add_layer_test(Convolution1D)
ncnn_add_layer_test(Convolution3D)
ncnn_add_layer_test(ConvolutionDepthWise)
ncnn_add_layer_test(ConvolutionDepthWise1D)
ncnn_add_layer_test(ConvolutionDepthWise3D)
ncnn_add_layer_test(Crop)
ncnn_add_layer_test(Deconvolution)
ncnn_add_layer_test(Deconvolution1D)
ncnn_add_layer_test(Deconvolution3D)
ncnn_add_layer_test(DeconvolutionDepthWise)
ncnn_add_layer_test(DeconvolutionDepthWise1D)
ncnn_add_layer_test(DeconvolutionDepthWise3D)
ncnn_add_layer_test(DeepCopy)
ncnn_add_layer_test(DeformableConv2D)
ncnn_add_layer_test(Dequantize)
ncnn_add_layer_test(Dropout)
ncnn_add_layer_test(Einsum)
ncnn_add_layer_test(Eltwise)
ncnn_add_layer_test(ELU)
ncnn_add_layer_test(ExpandDims)
ncnn_add_layer_test(Flatten)
ncnn_add_layer_test(GELU)
ncnn_add_layer_test(Gemm)
ncnn_add_layer_test(GroupNorm)
ncnn_add_layer_test(GRU)
ncnn_add_layer_test(HardSigmoid)
ncnn_add_layer_test(HardSwish)
ncnn_add_layer_test(InnerProduct)
ncnn_add_layer_test(InstanceNorm)
ncnn_add_layer_test(Interp)
ncnn_add_layer_test(LayerNorm)
ncnn_add_layer_test(LRN)
ncnn_add_layer_test(LSTM)
ncnn_add_layer_test(MatMul)
ncnn_add_layer_test(MemoryData)
ncnn_add_layer_test(Mish)
ncnn_add_layer_test(MultiHeadAttention)
ncnn_add_layer_test(Noop)
ncnn_add_layer_test(Normalize)
ncnn_add_layer_test(Packing)
ncnn_add_layer_test(Padding)
ncnn_add_layer_test(Permute)
ncnn_add_layer_test(PixelShuffle)
ncnn_add_layer_test(Pooling)
ncnn_add_layer_test(Pooling1D)
ncnn_add_layer_test(Pooling3D)
ncnn_add_layer_test(Power)
ncnn_add_layer_test(PReLU)
ncnn_add_layer_test(PriorBox)
ncnn_add_layer_test(Quantize)
ncnn_add_layer_test(Reduction)
ncnn_add_layer_test(ReLU)
ncnn_add_layer_test(Reorg)
ncnn_add_layer_test(Requantize)
ncnn_add_layer_test(Reshape)
ncnn_add_layer_test(RNN)
ncnn_add_layer_test(ROIPooling)
ncnn_add_layer_test(ROIAlign)
ncnn_add_layer_test(Scale)
ncnn_add_layer_test(SELU)
ncnn_add_layer_test(ShuffleChannel)
ncnn_add_layer_test(Sigmoid)
ncnn_add_layer_test(Slice)
ncnn_add_layer_test(Softmax)
ncnn_add_layer_test(Softplus)
ncnn_add_layer_test(Squeeze)
ncnn_add_layer_test(Swish)
ncnn_add_layer_test(TanH)
ncnn_add_layer_test(Tile)
ncnn_add_layer_test(UnaryOp)
ncnn_add_layer_test(Yolov3DetectionOutput)