提交 0e6a18be 编写于 作者: G gangliao 提交者: GitHub

Merge pull request #2339 from wangkuiyi/move_majel_tests

Move majel/test/* to majel/; Update generic.cmake
...@@ -94,6 +94,7 @@ endfunction(cc_binary) ...@@ -94,6 +94,7 @@ endfunction(cc_binary)
# DEPS # DEPS
# tensor) # tensor)
function(cc_test TARGET_NAME) function(cc_test TARGET_NAME)
if(WITH_TESTING)
set(options "") set(options "")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
...@@ -106,6 +107,7 @@ function(cc_test TARGET_NAME) ...@@ -106,6 +107,7 @@ function(cc_test TARGET_NAME)
link_glog_gflags(${TARGET_NAME}) link_glog_gflags(${TARGET_NAME})
link_gtest(${TARGET_NAME}) link_gtest(${TARGET_NAME})
add_test(${TARGET_NAME} ${TARGET_NAME}) add_test(${TARGET_NAME} ${TARGET_NAME})
endif()
endfunction(cc_test) endfunction(cc_test)
# Suppose that ops.cu includes global functions that take Tensor as # Suppose that ops.cu includes global functions that take Tensor as
...@@ -117,6 +119,7 @@ endfunction(cc_test) ...@@ -117,6 +119,7 @@ endfunction(cc_test)
# DEPS # DEPS
# tensor) # tensor)
function(nv_library TARGET_NAME) function(nv_library TARGET_NAME)
if (WITH_GPU)
set(options OPTIONAL) set(options OPTIONAL)
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
...@@ -129,9 +132,11 @@ function(nv_library TARGET_NAME) ...@@ -129,9 +132,11 @@ function(nv_library TARGET_NAME)
if (nv_library_DEPS) if (nv_library_DEPS)
add_dependencies(${TARGET_NAME} ${nv_library_DEPS}) add_dependencies(${TARGET_NAME} ${nv_library_DEPS})
endif() endif()
endif()
endfunction(nv_library) endfunction(nv_library)
function(nv_binary TARGET_NAME) function(nv_binary TARGET_NAME)
if (WITH_GPU)
set(options "") set(options "")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
...@@ -142,6 +147,7 @@ function(nv_binary TARGET_NAME) ...@@ -142,6 +147,7 @@ function(nv_binary TARGET_NAME)
add_dependencies(${TARGET_NAME} ${nv_binary_DEPS}) add_dependencies(${TARGET_NAME} ${nv_binary_DEPS})
endif() endif()
link_glog_gflags(${TARGET_NAME}) link_glog_gflags(${TARGET_NAME})
endif()
endfunction(nv_binary) endfunction(nv_binary)
# The dependency to target tensor implies that if any of # The dependency to target tensor implies that if any of
...@@ -152,6 +158,7 @@ endfunction(nv_binary) ...@@ -152,6 +158,7 @@ endfunction(nv_binary)
# DEPS # DEPS
# ops) # ops)
function(nv_test TARGET_NAME) function(nv_test TARGET_NAME)
if (WITH_GPU AND WITH_TESTING)
set(options "") set(options "")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
...@@ -164,6 +171,7 @@ function(nv_test TARGET_NAME) ...@@ -164,6 +171,7 @@ function(nv_test TARGET_NAME)
link_glog_gflags(${TARGET_NAME}) link_glog_gflags(${TARGET_NAME})
link_gtest(${TARGET_NAME}) link_gtest(${TARGET_NAME})
add_test(${TARGET_NAME} ${TARGET_NAME}) add_test(${TARGET_NAME} ${TARGET_NAME})
endif()
endfunction(nv_test) endfunction(nv_test)
set(GOPATH "${CMAKE_CURRENT_BINARY_DIR}/go") set(GOPATH "${CMAKE_CURRENT_BINARY_DIR}/go")
......
cc_library(place SRCS place.cc) cc_library(place SRCS place.cc)
cc_test(place_test SRCS place_test.cc DEPS place)
cc_library(ddim SRCS ddim.cc) cc_library(ddim SRCS ddim.cc)
cc_test(ddim_test SRCS ddim_test.cc DEPS ddim)
if(WITH_TESTING) nv_test(cuda_test SRCS cuda_test.cu)
add_subdirectory(test) nv_test(dim_test SRCS dim_test.cu DEPS ddim)
endif()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册