[PATCH] D24585: [test-suite] Organize build targets for CUDA tests.

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 14:27:15 PDT 2016


tra created this revision.
tra added a reviewer: jlebar.
tra added a subscriber: llvm-commits.
Herald added subscribers: jlebar, mgorny, beanz.

Now target hierarchy looks like this:

cuda-tests-all:
  cuda-tests-simple:
    cuda-tests-simple-{variant}:
       <test name>-{variant}
  cuda-tests-thrust:
    cuda-tests-thrust-{variant}:
       <test name>-{variant}


https://reviews.llvm.org/D24585

Files:
  External/CUDA/CMakeLists.txt

Index: External/CUDA/CMakeLists.txt
===================================================================
--- External/CUDA/CMakeLists.txt
+++ External/CUDA/CMakeLists.txt
@@ -70,7 +70,7 @@
 endmacro()
 
 function(create_thrust_tests VariantSuffix)
-  set(_ThrustMainTarget thrust-${VariantSuffix})
+  set(_ThrustMainTarget cuda-tests-thrust-${VariantSuffix})
   if(LARGE_PROBLEM_SIZE)
     set(_ExtraThrustTestArgs "--sizes=large")
   endif()
@@ -105,6 +105,7 @@
     target_compile_options(${_target} PUBLIC ${THRUST_CPPFLAGS})
     target_link_libraries(${_target} ${VariantLibs})
   endif()
+  add_dependencies(cuda-tests-thrust ${_ThrustMainTarget})
   list(APPEND VARIANT_CUDA_TESTS ${_ThrustMainTarget})
   set(VARIANT_CUDA_TESTS ${VARIANT_CUDA_TESTS} PARENT_SCOPE)
 endfunction()
@@ -196,6 +197,7 @@
 
   if(EXISTS "${TEST_SUITE_CUDA_ROOT}/thrust")
     message(STATUS "Found Thrust ${THRUST_PATH}")
+    add_custom_target(cuda-tests-thrust COMMENT "All thrust tests.")
     if(THRUST_SPLIT_TESTS)
       message(WARNING
 	"############################################################\n"
@@ -248,9 +250,7 @@
         # Add libstdc++ as link dependency.
         set(_Stdlib_Libs libstdcxx-${_GccVersion})
 
-        set(VARIANT_CUDA_TESTS)
         create_cuda_test_variant("${_Cuda_Suffix}-${_Std_Suffix}-${_Gcc_Suffix}")
-        list(APPEND ALL_CUDA_TESTS ${VARIANT_CUDA_TESTS})
       endforeach()
 
       if (HAVE_LIBCXX)
@@ -261,15 +261,13 @@
 	set(_Stdlib_CPPFLAGS -stdlib=libc++ -I${_compiler_path}/../include)
 	set(_Stdlib_LDFLAGS  -stdlib=libc++)
 	set(_Stdlib_Libs libcxx)
-	set(VARIANT_CUDA_TESTS)
 	create_cuda_test_variant("${_Cuda_Suffix}-${_Std_Suffix}-libc++")
-	list(APPEND ALL_CUDA_TESTS ${VARIANT_CUDA_TESTS})
       endif()
     endforeach()
   endforeach()
 
   # convenience target to build all CUDA tests.
-  add_custom_target(cuda-tests-all DEPENDS ${ALL_CUDA_TESTS}
+  add_custom_target(cuda-tests-all DEPENDS cuda-tests-simple cuda-tests-thrust
     COMMENT "Build all CUDA tests.")
 endmacro(create_cuda_tests)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24585.71436.patch
Type: text/x-patch
Size: 2049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160914/9bf5e8f4/attachment.bin>


More information about the llvm-commits mailing list