CMakeLists.txt 1.0 KB
Newer Older
Z
zhangjinchao01 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# common package contains:
#   * the utilities:
#       * Thread Libs
#       * Memory Manage libs
#       * CommandLine Parser
#       * Logging
#       * Timer/Stats
#   * the math libraries:
#       * Matrix/Vector
#   * the parameter optimizers.
#   * the parameter updater functions.
#
# TODO(yuyang18): separate libs.
#
file(GLOB MATH_HEADERS . *.h)
file(GLOB MATH_SOURCES . *.cpp)
set(MATH_SOURCES
    "${PROJ_ROOT}/paddle/math/BaseMatrix.cu"
H
hedaoyuan 已提交
19
    "${PROJ_ROOT}/paddle/math/TrainingAlgorithmOp.cu"
Z
zhangjinchao01 已提交
20 21 22 23
    ${MATH_SOURCES})
if(NOT WITH_GPU)
    # then compile BaseMatrix.cu as c++ file
    compile_cu_as_cpp("${PROJ_ROOT}/paddle/math/BaseMatrix.cu")
H
hedaoyuan 已提交
24
    compile_cu_as_cpp("${PROJ_ROOT}/paddle/math/TrainingAlgorithmOp.cu")
Z
zhangjinchao01 已提交
25 26 27
    add_library(paddle_math STATIC
        ${MATH_SOURCES})
else()
H
hedaoyuan 已提交
28
    cuda_add_library(paddle_math ${MATH_SOURCES})
Z
zhangjinchao01 已提交
29 30 31 32 33 34 35 36 37 38 39
endif()



add_style_check_target(paddle_math ${MATH_SOURCES})
add_style_check_target(paddle_math ${MATH_HEADERS})

add_dependencies(paddle_math gen_proto_cpp)  # depends
if(WITH_TESTING)
    add_subdirectory(tests)
endif()