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

3 4 5
add_simple_unittest(test_LinearChainCRF)
add_simple_unittest(test_MultinomialSampler)
add_simple_unittest(test_RecurrentLayer)
Z
zhangjinchao01 已提交
6

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
function(gserver_test TARGET)
  add_unittest_without_exec(${TARGET}
      ${TARGET}.cpp
      LayerGradUtil.cpp)
  add_test(NAME ${TARGET}
      COMMAND ${TARGET})
endfunction()

gserver_test(test_LayerGrad)
gserver_test(test_CRFLayerGrad)
gserver_test(test_CrossEntropyOverBeamGrad)
gserver_test(test_SeqSliceLayerGrad)
gserver_test(test_ActivationGrad)
gserver_test(test_ConvTrans)
gserver_test(test_PriorBox)
gserver_test(test_DetectionOutput)
gserver_test(test_ConvUnify)
gserver_test(test_BatchNorm)
gserver_test(test_KmaxSeqScore)
gserver_test(test_Expand)
X
xzl 已提交
27
gserver_test(test_MaxPoolingWithMaskOutput)
Z
zhangjinchao01 已提交
28

T
tensor-tang 已提交
29 30
########## test_Mkldnn layers and activations ##########
if(WITH_MKLDNN)
31 32 33
    add_unittest_without_exec(test_MKLDNN
        test_MKLDNN.cpp
        MKLDNNTester.cpp
T
tensor-tang 已提交
34
        LayerGradUtil.cpp)
35 36 37 38
    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 已提交
39 40
endif()

Z
zhangjinchao01 已提交
41 42 43
############## test_PyDataProvider ########################
if(WITH_PYTHON)
    add_unittest_without_exec(test_PyDataProvider
44
        test_PyDataProvider.cpp)
Z
zhangjinchao01 已提交
45 46

    add_test(NAME test_PyDataProvider
47 48
        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 已提交
49 50
endif()

51 52
############### test_WarpCTCLayer #######################
if(NOT WITH_DOUBLE)
53
    add_unittest_without_exec(test_WarpCTCLayer
54
        test_WarpCTCLayer.cpp)
55 56

    add_test(NAME test_WarpCTCLayer
L
liaogang 已提交
57
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_WarpCTCLayer --warpctc_dir=${WARPCTC_LIB_DIR}
58
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
59 60
endif()

H
hedaoyuan 已提交
61
if(NOT MOBILE_INFERENCE)
62 63 64
################### test_ProtoDataProvider ############
    add_unittest_without_exec(test_ProtoDataProvider
        test_ProtoDataProvider.cpp)
H
hedaoyuan 已提交
65

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
    # 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)

################## test_Evaluator #######################
    add_unittest(test_Evaluator
        test_Evaluator.cpp)
      
############### test_RecurrentGradientMachine ###############
    # 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)
      
############### test_NetworkCompare ###############
H
hedaoyuan 已提交
89 90 91 92 93 94 95 96 97 98 99
    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 已提交
100 101 102 103 104 105 106
endif()


add_unittest_without_exec(test_PyDataProvider2
        test_PyDataProvider2.cpp)

add_test(NAME test_PyDataProvider2
107 108
   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 已提交
109
)