[HIPIFY][tests][fix] Add correct CUDA version detection while testing

+ Just do load_config for lit.site.cfg earlier in lit.cfg to get initialized cuda_version
+ Remove lit.cfg.in for CMake variables substitution
+ Return back lit.cfg
+ Exclude CUDA 9.0 tests if CUDA < 9.0
+ Report CUDA version before running tests
Цей коміт міститься в:
Evgeny Mankov
2018-12-12 17:05:01 +03:00
джерело b955e317a7
коміт 3d528cf491
3 змінених файлів з 21 додано та 29 видалено
-6
Переглянути файл
@@ -111,12 +111,6 @@ if (HIPIFY_CLANG_TESTS)
@ONLY
)
configure_file(
${CMAKE_CURRENT_LIST_DIR}/../tests/hipify-clang/lit.cfg.in
${CMAKE_CURRENT_LIST_DIR}/../tests/hipify-clang/lit.cfg
@ONLY
)
add_lit_testsuite(test-hipify "Running HIPify regression tests"
${CMAKE_CURRENT_LIST_DIR}/../tests/hipify-clang
PARAMS site_config=${CMAKE_CURRENT_BINARY_DIR}/tests/hipify-clang/lit.site.cfg
+18 -22
Переглянути файл
@@ -8,6 +8,24 @@ import lit.formats
import lit.util
# Configuration file for the 'lit' test runner.
site_cfg = lit_config.params.get('site_config', None)
lit_config.load_config(config, site_cfg)
print("CUDA " + config.cuda_version + " will be used for testing.")
config.excludes = ['cmdparser.hpp']
if config.cuda_version_major < 9:
config.excludes.append('cuSPARSE_04.cu')
config.excludes.append('cuSPARSE_05.cu')
config.excludes.append('cuSPARSE_06.cu')
config.excludes.append('cuSPARSE_07.cu')
if config.cuda_version_major < 10:
config.excludes.append('cuSPARSE_08.cu')
config.excludes.append('cuSPARSE_09.cu')
config.excludes.append('cuSPARSE_10.cu')
config.excludes.append('cuSPARSE_11.cu')
# name: The name of this test suite.
config.name = 'hipify'
@@ -21,25 +39,6 @@ config.test_format = lit.formats.ShTest()
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
config.excludes = ['cmdparser.hpp']
cuda_version_major = int("@CUDA_VERSION_MAJOR@")
cuda_version = "@CUDA_VERSION@"
if cuda_version_major < 9:
config.excludes.append('cuSPARSE_04.cu')
config.excludes.append('cuSPARSE_05.cu')
config.excludes.append('cuSPARSE_06.cu')
config.excludes.append('cuSPARSE_07.cu')
if cuda_version_major < 10:
config.excludes.append('cuSPARSE_08.cu')
config.excludes.append('cuSPARSE_09.cu')
config.excludes.append('cuSPARSE_10.cu')
config.excludes.append('cuSPARSE_11.cu')
print("CUDA " + cuda_version + " will be used for testing.")
# test_exec_root: The path where tests are located (default is the test suite root).
#config.test_exec_root = config.test_source_root
@@ -49,9 +48,6 @@ config.target_triple = '(unused)'
# available_features: Used by ShTest and TclTest formats for REQUIRES checks.
config.available_features = []
site_cfg = lit_config.params.get('site_config', None)
lit_config.load_config(config, site_cfg)
obj_root = getattr(config, 'obj_root', None)
if obj_root is not None:
config.test_exec_root = obj_root
+3 -1
Переглянути файл
@@ -5,10 +5,12 @@ config.llvm_tools_dir = "@LLVM_TOOLS_BINARY_DIR@"
config.obj_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.cuda_root = "@CUDA_TOOLKIT_ROOT_DIR@"
config.cuda_dnn_root = "@CUDA_DNN_ROOT_DIR@"
config.cuda_version_major = int("@CUDA_VERSION_MAJOR@")
config.cuda_version = "@CUDA_VERSION@"
if sys.platform in ['win32']:
config.cuda_sdk_root = "@CUDA_SDK_ROOT_DIR@"
if not config.cuda_sdk_root or config.cuda_sdk_root == "CUDA_SDK_ROOT_DIR-NOTFOUND":
cuda_version = "@CUDA_VERSION@"
cuda_version = config.cuda_version
cuda_version = cuda_version.replace('.','_')
config.cuda_samples_root = os.environ.get('NVCUDASAMPLES' + cuda_version + '_ROOT')
if not config.cuda_samples_root: