create marian lib

This commit is contained in:
Hieu Hoang 2016-09-14 22:37:27 +02:00
parent adbc97f448
commit ab8bef8a03

View File

@ -1,43 +1,37 @@
include_directories(.) include_directories(.)
add_library(libcommon OBJECT cuda_add_library(marian_lib
cnpy/cnpy.cpp cnpy/cnpy.cpp
exception.cpp exception.cpp
)
cuda_add_library(common_cuda
expressions.cu expressions.cu
test.cu test.cu
tensor.cu tensor.cu
tensor_operators.cu tensor_operators.cu
) )
target_link_libraries(common_cuda) target_link_libraries(marian_lib)
cuda_add_executable( cuda_add_executable(
marian marian
tensor_operators.cu tensor_operators.cu
$<TARGET_OBJECTS:libcommon>
) )
target_link_libraries(marian common_cuda) target_link_libraries(marian marian_lib)
cuda_add_executable( cuda_add_executable(
train_mnist train_mnist
train_mnist.cu train_mnist.cu
$<TARGET_OBJECTS:libcommon>
) )
target_link_libraries(train_mnist common_cuda) target_link_libraries(train_mnist marian_lib)
cuda_add_executable( cuda_add_executable(
validate_mnist validate_mnist
validate_mnist.cu validate_mnist.cu
$<TARGET_OBJECTS:libcommon>
) )
target_link_libraries(validate_mnist common_cuda) target_link_libraries(validate_mnist marian_lib)
foreach(exec marian train_mnist validate_mnist) foreach(exec marian train_mnist validate_mnist)
target_link_libraries(${exec} ${EXT_LIBS} cuda cudnn) target_link_libraries(${exec} ${EXT_LIBS} cuda cudnn)