[test-suite] r289616 - [test-suite, CUDA] Added lit.local.cfg for CUDA tests.

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 16:00:57 PST 2016


Author: tra
Date: Tue Dec 13 18:00:56 2016
New Revision: 289616

URL: http://llvm.org/viewvc/llvm-project?rev=289616&view=rev
Log:
[test-suite, CUDA] Added lit.local.cfg for CUDA tests.

CUDA apps are controlled via environment variables,
so we need to propagate them to the test environment
in order to control which GPU the tests get to use,
whether we want to force JIT, etc.

Added:
    test-suite/trunk/External/CUDA/lit.local.cfg
Modified:
    test-suite/trunk/External/CUDA/CMakeLists.txt

Modified: test-suite/trunk/External/CUDA/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/CUDA/CMakeLists.txt?rev=289616&r1=289615&r2=289616&view=diff
==============================================================================
--- test-suite/trunk/External/CUDA/CMakeLists.txt (original)
+++ test-suite/trunk/External/CUDA/CMakeLists.txt Tue Dec 13 18:00:56 2016
@@ -298,6 +298,9 @@ macro(create_cuda_tests)
   # convenience target to build all CUDA tests.
   add_custom_target(cuda-tests-all DEPENDS cuda-tests-simple cuda-tests-thrust
     COMMENT "Build all CUDA tests.")
+
+  # stage lit config needed to control how CUDA tests are run.
+  file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
 endmacro(create_cuda_tests)
 
 # We always want asserts() to run.

Added: test-suite/trunk/External/CUDA/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/CUDA/lit.local.cfg?rev=289616&view=auto
==============================================================================
--- test-suite/trunk/External/CUDA/lit.local.cfg (added)
+++ test-suite/trunk/External/CUDA/lit.local.cfg Tue Dec 13 18:00:56 2016
@@ -0,0 +1,17 @@
+# -*- python -*-
+
+import os
+
+cuda_env_vars = [
+    'CUDA_CACHE_DISABLE',
+    'CUDA_CACHE_MAXSIZE',
+    'CUDA_CACHE_PATH',
+    'CUDA_FORCE_PTX_JIT',
+    'CUDA_VISIBLE_DEVICES',
+]
+
+# We need to propagate cuda environment vars to tests so we can
+# control how/where the tests get executed.
+for var in cuda_env_vars:
+  if var in os.environ:
+    config.environment[var] = os.environ[var]




More information about the llvm-commits mailing list