[test-suite] r289589 - [test-suite, CUDA] Added targets for running simple CUDA tests.
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 13:27:32 PST 2016
Author: tra
Date: Tue Dec 13 15:27:31 2016
New Revision: 289589
URL: http://llvm.org/viewvc/llvm-project?rev=289589&view=rev
Log:
[test-suite, CUDA] Added targets for running simple CUDA tests.
"ninja check-cuda-simple" will build cuda-tests-simple and
will run them one variant at a time.
Individual variant can be checked with "ninja check-cuda-simple-<variant>".
GPU tests are not well suited for running in parallel as they
will be bottlenecked by GPU (few of them, high start-up overhead).
cmake -DCUDA_JOBS=N will set the limit on number of simultaneous
CUDA tests to N.
Modified:
test-suite/trunk/CMakeLists.txt
test-suite/trunk/External/CUDA/CMakeLists.txt
Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=289589&r1=289588&r2=289589&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Tue Dec 13 15:27:31 2016
@@ -144,6 +144,11 @@ if(ARCH STREQUAL "Mips")
check_symbol_exists(__mips64 "" MIPS_IS_MIPS64_ENABLED)
endif()
+find_program(TEST_SUITE_LIT NAMES "lit" "llvm-lit")
+set(TEST_SUITE_LIT_FLAGS "-sv" CACHE STRING "Flags used when running lit")
+mark_as_advanced(TEST_SUITE_LIT TEST_SUITE_LIT_FLAGS)
+mark_as_advanced(TEST_SUITE_LIT)
+
add_subdirectory(tools)
# Shortcut for the path to the fpcmp executable
set(FPCMP ${CMAKE_BINARY_DIR}/tools/fpcmp)
@@ -223,10 +228,6 @@ endif()
# Produce lit.site.cfg
configure_file("${PROJECT_SOURCE_DIR}/lit.site.cfg.in" "${CMAKE_BINARY_DIR}/lit.site.cfg")
-find_program(TEST_SUITE_LIT NAMES "lit" "llvm-lit")
-set(TEST_SUITE_LIT_FLAGS "-sv" CACHE STRING "Flags used when running lit")
-mark_as_advanced(TEST_SUITE_LIT TEST_SUITE_LIT_FLAGS)
-mark_as_advanced(TEST_SUITE_LIT)
get_property(TEST_SUITE_TARGETS GLOBAL PROPERTY TEST_SUITE_TARGETS)
add_custom_target(check
COMMAND ${TEST_SUITE_LIT} ${TEST_SUITE_LIT_FLAGS} .
Modified: test-suite/trunk/External/CUDA/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/CUDA/CMakeLists.txt?rev=289589&r1=289588&r2=289589&view=diff
==============================================================================
--- test-suite/trunk/External/CUDA/CMakeLists.txt (original)
+++ test-suite/trunk/External/CUDA/CMakeLists.txt Tue Dec 13 15:27:31 2016
@@ -40,6 +40,8 @@ macro(create_one_local_test Name FileGlo
target_link_libraries(${_executable} ${VariantLibs})
endif()
add_dependencies(cuda-tests-simple-${VariantSuffix} ${_executable})
+ # Local tests are presumed to be fast.
+ list(APPEND CUDA_SIMPLE_TEST_TARGETS ${_executable}.test)
endmacro()
# Create targets for CUDA tests that are part of the test suite.
@@ -132,6 +134,15 @@ function(create_cuda_test_variant Std Va
if(EXISTS ${THRUST_PATH} AND (NOT ${Std} STREQUAL "c++14"))
create_thrust_tests(${VariantSuffix})
endif()
+
+ # Target for CUDA tests that take little time to build and run.
+ add_custom_target(check-cuda-simple-${VariantSuffix}
+ COMMAND ${TEST_SUITE_LIT} ${TEST_SUITE_LIT_FLAGS}
+ ${CUDA_SIMPLE_TEST_TARGETS}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS cuda-tests-simple-${VariantSuffix}
+ USES_TERMINAL)
+ add_dependencies(check-cuda-simple check-cuda-simple-${VariantSuffix})
endfunction(create_cuda_test_variant)
macro(create_cuda_tests)
@@ -156,13 +167,19 @@ macro(create_cuda_tests)
# Special target to build all simple tests. Useful for quick smoke test
# before we embark on heavy-duty compilation which may not be worth it.
add_custom_target(cuda-tests-simple
- COMMENT "Build all simple CUDA tests")
+ COMMENT "Build all simple CUDA tests")
+ add_custom_target(check-cuda-simple
+ COMMENT "Run all simple CUDA tests")
# set default GPU arch
if(NOT CUDA_GPU_ARCH)
list(APPEND CUDA_GPU_ARCH sm_35)
endif()
+ if (CUDA_JOBS)
+ set(TEST_SUITE_LIT_FLAGS ${TEST_SUITE_LIT_FLAGS} -j ${CUDA_JOBS})
+ endif()
+
foreach(GpuArch IN LISTS CUDA_GPU_ARCH)
list(APPEND CPPFLAGS --cuda-gpu-arch=${GpuArch})
endforeach()
More information about the llvm-commits
mailing list