|
|
|
@ -94,6 +94,7 @@ endfunction(cc_binary)
|
|
|
|
|
# DEPS
|
|
|
|
|
# tensor)
|
|
|
|
|
function(cc_test TARGET_NAME)
|
|
|
|
|
if(WITH_TESTING)
|
|
|
|
|
set(options "")
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
@ -106,6 +107,7 @@ function(cc_test TARGET_NAME)
|
|
|
|
|
link_glog_gflags(${TARGET_NAME})
|
|
|
|
|
link_gtest(${TARGET_NAME})
|
|
|
|
|
add_test(${TARGET_NAME} ${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(cc_test)
|
|
|
|
|
|
|
|
|
|
# Suppose that ops.cu includes global functions that take Tensor as
|
|
|
|
@ -117,6 +119,7 @@ endfunction(cc_test)
|
|
|
|
|
# DEPS
|
|
|
|
|
# tensor)
|
|
|
|
|
function(nv_library TARGET_NAME)
|
|
|
|
|
if (WITH_GPU)
|
|
|
|
|
set(options OPTIONAL)
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
@ -129,9 +132,11 @@ function(nv_library TARGET_NAME)
|
|
|
|
|
if (nv_library_DEPS)
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_library_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(nv_library)
|
|
|
|
|
|
|
|
|
|
function(nv_binary TARGET_NAME)
|
|
|
|
|
if (WITH_GPU)
|
|
|
|
|
set(options "")
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
@ -142,6 +147,7 @@ function(nv_binary TARGET_NAME)
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_binary_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
link_glog_gflags(${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(nv_binary)
|
|
|
|
|
|
|
|
|
|
# The dependency to target tensor implies that if any of
|
|
|
|
@ -152,6 +158,7 @@ endfunction(nv_binary)
|
|
|
|
|
# DEPS
|
|
|
|
|
# ops)
|
|
|
|
|
function(nv_test TARGET_NAME)
|
|
|
|
|
if (WITH_GPU AND WITH_TESTING)
|
|
|
|
|
set(options "")
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
@ -164,6 +171,7 @@ function(nv_test TARGET_NAME)
|
|
|
|
|
link_glog_gflags(${TARGET_NAME})
|
|
|
|
|
link_gtest(${TARGET_NAME})
|
|
|
|
|
add_test(${TARGET_NAME} ${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(nv_test)
|
|
|
|
|
|
|
|
|
|
set(GOPATH "${CMAKE_CURRENT_BINARY_DIR}/go")
|
|
|
|
|