CMakeLists.txt 5.9 KB
Newer Older
Z
zhangjinchao01 已提交
1 2
# gserver pacakge unittests

H
hedaoyuan 已提交
3
if(NOT MOBILE_INFERENCE)
Z
zhangjinchao01 已提交
4
################### test_ProtoDataProvider ############
H
hedaoyuan 已提交
5 6 7 8 9 10 11 12 13 14
    add_unittest_without_exec(test_ProtoDataProvider
        test_ProtoDataProvider.cpp)

    # test_ProtoDataProvider will mkdir as same name,
    # so if WORKING_DIRECTORY is default directory, then
    # mkdir will get error.
    add_test(NAME test_ProtoDataProvider
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_ProtoDataProvider
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
endif()
Z
zhangjinchao01 已提交
15 16 17 18

################# test_LayerGrad #######################
add_unittest_without_exec(test_LayerGrad
    test_LayerGrad.cpp
19
    LayerGradUtil.cpp)
Z
zhangjinchao01 已提交
20
add_test(NAME test_LayerGrad
21
    COMMAND test_LayerGrad)
Z
zhangjinchao01 已提交
22

T
tensor-tang 已提交
23 24
########## test_Mkldnn layers and activations ##########
if(WITH_MKLDNN)
25 26 27
    add_unittest_without_exec(test_MKLDNN
        test_MKLDNN.cpp
        MKLDNNTester.cpp
T
tensor-tang 已提交
28
        LayerGradUtil.cpp)
29 30 31 32
    add_test(NAME test_MKLDNN
        COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python
            ${CMAKE_CURRENT_BINARY_DIR}/test_MKLDNN
            WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
T
tensor-tang 已提交
33 34
endif()

35 36 37
################ test_CRFLayerGrad ####################
add_unittest_without_exec(test_CRFLayerGrad
    test_CRFLayerGrad.cpp
P
Peng Li 已提交
38
    LayerGradUtil.cpp)
39 40 41
add_test(NAME test_CRFLayerGrad
    COMMAND test_CRFLayerGrad)

C
caoying03 已提交
42 43 44 45 46 47
################ test_CrossEntropyOverBeam ####################
add_unittest_without_exec(test_CrossEntropyOverBeam
    test_CrossEntropyOverBeamGrad.cpp
    LayerGradUtil.cpp)
add_test(NAME test_CrossEntropyOverBeam
    COMMAND test_CrossEntropyOverBeam)
48

C
caoying03 已提交
49 50 51 52 53 54
################ test_SeqSliceLayerGrad ####################
add_unittest_without_exec(test_SeqSliceLayerGrad
    test_SeqSliceLayerGrad.cpp
    LayerGradUtil.cpp)
add_test(NAME test_SeqSliceLayerGrad
    COMMAND test_SeqSliceLayerGrad)
55

56 57
add_unittest_without_exec(test_ActivationGrad
    test_ActivationGrad.cpp
58
    LayerGradUtil.cpp)
59 60
add_test(NAME test_ActivationGrad
    COMMAND test_ActivationGrad)
61 62 63
################# test_ConvTrans #######################
add_unittest_without_exec(test_ConvTrans
    test_ConvTrans.cpp
64
    LayerGradUtil.cpp)
65 66 67

add_test(NAME test_ConvTrans
    COMMAND test_ConvTrans)
G
gaoyuan 已提交
68 69 70
################# test_PriorBox #######################
add_unittest_without_exec(test_PriorBox
    test_PriorBox.cpp
71
    LayerGradUtil.cpp)
G
gaoyuan 已提交
72 73 74

add_test(NAME test_PriorBox
    COMMAND test_PriorBox)
75 76 77 78 79
################# test_DetectionOutput #######################
add_unittest_without_exec(test_DetectionOutput
    test_DetectionOutput.cpp
    LayerGradUtil.cpp)

X
xuwei06 已提交
80
add_test(NAME test_DetectionOutput
81
    COMMAND test_DetectionOutput)
W
wangyang59 已提交
82 83 84
################# test_ConvUnify #######################
add_unittest_without_exec(test_ConvUnify
    test_ConvUnify.cpp
85
    LayerGradUtil.cpp)
86

W
wangyang59 已提交
87 88
add_test(NAME test_ConvUnify
    COMMAND test_ConvUnify)
89 90 91
################# test_BatchNorm #######################
add_unittest_without_exec(test_BatchNorm
    test_BatchNorm.cpp
92
    LayerGradUtil.cpp)
93 94 95

add_test(NAME test_BatchNorm
    COMMAND test_BatchNorm)
C
caoying03 已提交
96 97 98 99 100 101 102 103 104 105


################# test_KmaxSeqScore #######################
add_unittest_without_exec(test_KmaxSeqScore
    test_KmaxSeqScore.cpp
    LayerGradUtil.cpp)

add_test(NAME test_KmaxSeqScore
    COMMAND test_KmaxSeqScore)

H
hedaoyuan 已提交
106
if(NOT MOBILE_INFERENCE)
Z
zhangjinchao01 已提交
107
################## test_Evaluator #######################
H
hedaoyuan 已提交
108 109 110
    add_unittest(test_Evaluator
        test_Evaluator.cpp)
endif()
Z
zhangjinchao01 已提交
111 112 113 114

################ test_LinearChainCRF ####################
add_simple_unittest(test_LinearChainCRF)

115
if(NOT MOBILE_INFERENCE)
Z
zhangjinchao01 已提交
116 117
############## test_MultinomialSampler ###################
add_simple_unittest(test_MultinomialSampler)
118
endif()
Z
zhangjinchao01 已提交
119 120 121 122

############## test_PyDataProvider ########################
if(WITH_PYTHON)
    add_unittest_without_exec(test_PyDataProvider
123
        test_PyDataProvider.cpp)
Z
zhangjinchao01 已提交
124 125

    add_test(NAME test_PyDataProvider
126 127
        COMMAND .set_python_path.sh -d ./gserver/tests:${PADDLE_SOURCE_DIR}/python/ ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProvider
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
Z
zhangjinchao01 已提交
128 129 130
endif()

############### test_RecurrentLayer #######################
131
add_simple_unittest(test_RecurrentLayer)
Z
zhangjinchao01 已提交
132

133
############### test_WarpCTCLayer #######################
134
if(NOT WITH_DOUBLE AND NOT MOBILE_INFERENCE)
135
    add_unittest_without_exec(test_WarpCTCLayer
136
        test_WarpCTCLayer.cpp)
137 138

    add_test(NAME test_WarpCTCLayer
L
liaogang 已提交
139
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_WarpCTCLayer --warpctc_dir=${WARPCTC_LIB_DIR}
140
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
141 142
endif()

H
hedaoyuan 已提交
143
if(NOT MOBILE_INFERENCE)
Z
zhangjinchao01 已提交
144
############### test_RecurrentGradientMachine ###############
H
hedaoyuan 已提交
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
  # TODO(yuyang18): There is some bug in test_RecurrentGradientMachine
  # I will fix it.
  add_unittest_without_exec(test_RecurrentGradientMachine
      test_RecurrentGradientMachine.cpp)
  add_test(NAME test_RecurrentGradientMachine
      COMMAND .set_python_path.sh -d
              ${PADDLE_SOURCE_DIR}/python:${PADDLE_SOURCE_DIR}/paddle/gserver/tests
              ${CMAKE_CURRENT_BINARY_DIR}/test_RecurrentGradientMachine
      WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
endif()

if(NOT MOBILE_INFERENCE)
    add_unittest_without_exec(test_NetworkCompare
        test_NetworkCompare.cpp)
    if(WITH_GPU)
        add_test(NAME test_NetworkCompare
            COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python ${CMAKE_CURRENT_BINARY_DIR}/test_NetworkCompare --use_gpu=true
            WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
    else()
        add_test(NAME test_NetworkCompare
            COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python ${CMAKE_CURRENT_BINARY_DIR}/test_NetworkCompare --use_gpu=false
            WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
    endif()
Z
zhangjinchao01 已提交
168 169 170 171 172 173 174
endif()


add_unittest_without_exec(test_PyDataProvider2
        test_PyDataProvider2.cpp)

add_test(NAME test_PyDataProvider2
175 176
   COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/paddle/gserver/tests:${PADDLE_SOURCE_DIR}/python ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProvider2
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle
Z
zhangjinchao01 已提交
177
)