CMakeLists.txt 1.3 KB
Newer Older
H
hedaoyuan 已提交
1 2
file(GLOB h_files . *Op.h)
file(GLOB cpp_files . *Op.cpp)
3 4 5

list(APPEND h_files Function.h)
list(APPEND cpp_files Function.cpp)
6
list(APPEND cpp_files BufferArg.cpp)
7 8

if(WITH_GPU)
H
hedaoyuan 已提交
9
    file(GLOB cu_files . *OpGpu.cu)
10
    cuda_compile(cu_objs ${cu_files})
H
hedaoyuan 已提交
11 12
endif()

13 14 15 16 17
if(USE_NNPACK)
  include(nnpack/nnpack.cmake)
  list(APPEND cpp_files nnpack/NNPACKConvOp.cpp)
endif()

18
add_library(paddle_function STATIC ${cpp_files} ${cu_objs})
19
add_dependencies(paddle_function ${external_project_dependencies})
20
add_dependencies(paddle_function gen_proto_cpp)
21

H
hedaoyuan 已提交
22
if(WITH_TESTING)
23
if(WITH_GPU)
24
    # TODO:
H
hedaoyuan 已提交
25
    # file(GLOB test_files . *OpTest.cpp)
26
    # add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_files})
H
hedaoyuan 已提交
27
    add_simple_unittest(CrossMapNormalOpTest)
28 29 30
    add_simple_unittest(TensorShapeTest)
    add_simple_unittest(TensorTypeTest)
    add_simple_unittest(BufferArgTest)
H
hedaoyuan 已提交
31
    add_simple_unittest(FunctionTest)
32
    add_simple_unittest(ContextProjectionOpTest)
D
dangqingqing 已提交
33
    add_simple_unittest(PadOpTest)
34
    add_simple_unittest(MulOpTest)
35
    add_simple_unittest(CosSimOpTest)
D
dangqingqing 已提交
36
    add_simple_unittest(RowConvOpTest)
37
endif()
38 39

add_simple_unittest(ConvOpTest)
H
hedaoyuan 已提交
40
endif()
41 42 43 44 45 46

add_style_check_target(paddle_function ${h_files})
add_style_check_target(paddle_function ${cpp_files})
if(WITH_GPU)
    add_style_check_target(paddle_function ${cu_files})
endif()