From d38bbc99aaef4e907bfbfde63cd1f254e71288e2 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Tue, 11 Dec 2018 22:03:11 +0300 Subject: [PATCH] [HIPIFY][tests][fix] Add correct CUDA version detection while testing + Add lit.cfg.in for CMake variables substitution to now generated lit.cfg + Exclude lit.cfg + Exclude CUDA 9.0 tests if CUDA < 9.0 + Report CUDA version before running tests [ROCm/clr commit: 2b01f1eb6f41f16d2f88313a09bb0d88ac7c2442] --- projects/clr/hipamd/hipify-clang/CMakeLists.txt | 6 ++++++ .../tests/hipify-clang/{lit.cfg => lit.cfg.in} | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) rename projects/clr/hipamd/tests/hipify-clang/{lit.cfg => lit.cfg.in} (85%) diff --git a/projects/clr/hipamd/hipify-clang/CMakeLists.txt b/projects/clr/hipamd/hipify-clang/CMakeLists.txt index 56de7c7904..de1d2d8770 100644 --- a/projects/clr/hipamd/hipify-clang/CMakeLists.txt +++ b/projects/clr/hipamd/hipify-clang/CMakeLists.txt @@ -111,6 +111,12 @@ 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 diff --git a/projects/clr/hipamd/tests/hipify-clang/lit.cfg b/projects/clr/hipamd/tests/hipify-clang/lit.cfg.in similarity index 85% rename from projects/clr/hipamd/tests/hipify-clang/lit.cfg rename to projects/clr/hipamd/tests/hipify-clang/lit.cfg.in index f959147cd6..3518ddd425 100644 --- a/projects/clr/hipamd/tests/hipify-clang/lit.cfg +++ b/projects/clr/hipamd/tests/hipify-clang/lit.cfg.in @@ -23,13 +23,23 @@ config.test_source_root = os.path.dirname(__file__) config.excludes = ['cmdparser.hpp'] -config.cuda_version = "@CUDA_VERSION@" -if config.cuda_version not in ['10.0']: +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