From ede19d7b9e52c485e5cc826acae4ea8c4f047376 Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Wed, 2 Aug 2023 16:08:57 +0200 Subject: [PATCH 1/2] add mdspan tests to the CI --- script/job_generator/alpaka_filter.py | 8 ++++++++ script/job_generator/alpaka_globals.py | 3 +++ script/job_generator/generate_job_yaml.py | 9 ++++++++- script/job_generator/job_generator.py | 1 + script/job_generator/verify.py | 2 +- script/job_generator/versions.py | 1 + script/run.sh | 12 ++++++++++++ script/run_generate.sh | 2 +- 8 files changed, 35 insertions(+), 3 deletions(-) diff --git a/script/job_generator/alpaka_filter.py b/script/job_generator/alpaka_filter.py index 3fa921c51fe9..6c0f4d2b8143 100644 --- a/script/job_generator/alpaka_filter.py +++ b/script/job_generator/alpaka_filter.py @@ -32,4 +32,12 @@ def alpaka_post_filter(row: List) -> bool: ): return False + # because of a compiler bug, we disable mdspan for NVCC <= 11.2 + if ( + row_check_version(row, MDSPAN, "==", ON_VER) + and row_check_name(row, DEVICE_COMPILER, "==", NVCC) + and row_check_version(row, DEVICE_COMPILER, "<=", "11.2") + ): + return False + return True diff --git a/script/job_generator/alpaka_globals.py b/script/job_generator/alpaka_globals.py index bff85cb42144..1ca7d8fc2e05 100644 --- a/script/job_generator/alpaka_globals.py +++ b/script/job_generator/alpaka_globals.py @@ -23,3 +23,6 @@ # CUDA SM level of the job # is empty, if there is no CUDA backend enabled SM_LEVEL: str = "sm_level" + +# enable mdspan support +MDSPAN: str = "mdspan" diff --git a/script/job_generator/generate_job_yaml.py b/script/job_generator/generate_job_yaml.py index 77975a9917f9..cdfb772f3fc5 100644 --- a/script/job_generator/generate_job_yaml.py +++ b/script/job_generator/generate_job_yaml.py @@ -61,12 +61,15 @@ def job_prefix_coding(job: Dict[str, Tuple[str, str]]) -> str: str: Job name Prefix. """ version_str = "" - for sw in [CMAKE, BOOST, UBUNTU, CXX_STANDARD, BUILD_TYPE]: + for sw in [CMAKE, BOOST, UBUNTU, CXX_STANDARD, MDSPAN, BUILD_TYPE]: if sw in job: if job[sw][NAME] == CXX_STANDARD: version_str += "_cxx" + job[sw][VERSION] elif job[sw][NAME] == BUILD_TYPE: version_str += "_" + job[sw][VERSION] + elif job[sw][NAME] == MDSPAN: + if job[sw][VERSION] == ON_VER: + version_str += "_mdspan" else: version_str += "_" + job[sw][NAME] + job[sw][VERSION] @@ -279,6 +282,10 @@ def job_variables(job: Dict[str, Tuple[str, str]]) -> Dict[str, str]: variables["alpaka_ACC_GPU_CUDA_ONLY_MODE"] = "OFF" variables[ALPAKA_ACC_GPU_HIP_ENABLE] = "OFF" variables["alpaka_ACC_GPU_HIP_ONLY_MODE"] = "OFF" + if job[MDSPAN][VERSION] == ON_VER: + variables["ALPAKA_TEST_MDSPAN"] = "ON" + else: + variables["ALPAKA_TEST_MDSPAN"] = "OFF" if job[DEVICE_COMPILER][NAME] == HIPCC: variables[ALPAKA_ACC_GPU_HIP_ENABLE] = "ON" diff --git a/script/job_generator/job_generator.py b/script/job_generator/job_generator.py index 8dcc30566c48..f38a90d56f29 100644 --- a/script/job_generator/job_generator.py +++ b/script/job_generator/job_generator.py @@ -128,6 +128,7 @@ def get_args() -> argparse.Namespace: parameters[CXX_STANDARD] = get_sw_tuple_list(CXX_STANDARD) parameters[BUILD_TYPE] = get_sw_tuple_list(BUILD_TYPE) parameters[JOB_EXECUTION_TYPE] = get_sw_tuple_list(JOB_EXECUTION_TYPE) + parameters[MDSPAN] = get_sw_tuple_list(MDSPAN) # print a warning, if a parameter value is not supported by the ajc-library verify_parameters(parameters) diff --git a/script/job_generator/verify.py b/script/job_generator/verify.py index 63693b0411f6..2a5a651920fb 100644 --- a/script/job_generator/verify.py +++ b/script/job_generator/verify.py @@ -33,7 +33,7 @@ def verify_parameters( f"{name}-{mod_version} is not officially supported by " "the alpaka-job-library." ) - elif param_name not in [BUILD_TYPE, JOB_EXECUTION_TYPE]: + elif param_name not in [BUILD_TYPE, JOB_EXECUTION_TYPE, MDSPAN]: for name, version in param_value: # if we compare a minor.major.patch version with a minor.major # version, the check is only true, if all three numbers matches diff --git a/script/job_generator/versions.py b/script/job_generator/versions.py index 318f50b2361b..7e007fdc9dcb 100644 --- a/script/job_generator/versions.py +++ b/script/job_generator/versions.py @@ -52,6 +52,7 @@ # use only TEST_COMPILE_ONLY, because TEST_RUNTIME will be set manually depend on some # conditions later JOB_EXECUTION_TYPE: [JOB_EXECUTION_COMPILE_ONLY], + MDSPAN: [ON_VER, OFF_VER], } diff --git a/script/run.sh b/script/run.sh index 3f27ff7d0e9a..b3309c3e941b 100755 --- a/script/run.sh +++ b/script/run.sh @@ -133,6 +133,18 @@ then fi fi +if [ -z "${ALPAKA_TEST_MDSPAN+x}" ]; +then + export alpaka_USE_MDSPAN=OFF +else + if [ "${ALPAKA_TEST_MDSPAN}" == "ON" ]; + then + export alpaka_USE_MDSPAN=FETCH + else + export alpaka_USE_MDSPAN=OFF + fi +fi + ./script/run_generate.sh ./script/run_build.sh diff --git a/script/run_generate.sh b/script/run_generate.sh index 8e7a185e95bd..463885452bf4 100755 --- a/script/run_generate.sh +++ b/script/run_generate.sh @@ -89,7 +89,7 @@ cd build/ "$(env2cmake alpaka_ACC_GPU_CUDA_ENABLE)" "$(env2cmake alpaka_ACC_GPU_CUDA_ONLY_MODE)" "$(env2cmake CMAKE_CUDA_ARCHITECTURES)" "$(env2cmake CMAKE_CUDA_COMPILER)" "$(env2cmake CMAKE_CUDA_FLAGS)" \ "$(env2cmake alpaka_CUDA_FAST_MATH)" "$(env2cmake alpaka_CUDA_FTZ)" "$(env2cmake alpaka_CUDA_SHOW_REGISTER)" "$(env2cmake alpaka_CUDA_KEEP_FILES)" "$(env2cmake alpaka_CUDA_EXPT_EXTENDED_LAMBDA)" "$(env2cmake CMAKE_CUDA_SEPARABLE_COMPILATION)" \ "$(env2cmake GPU_TARGETS)" "$(env2cmake alpaka_ACC_GPU_HIP_ENABLE)" "$(env2cmake alpaka_ACC_GPU_HIP_ONLY_MODE)" \ - "$(env2cmake alpaka_DEBUG)" "$(env2cmake alpaka_CI)" "$(env2cmake alpaka_CHECK_HEADERS)" "$(env2cmake alpaka_CXX_STANDARD)" "$(env2cmake CMAKE_INSTALL_PREFIX)" \ + "$(env2cmake alpaka_DEBUG)" "$(env2cmake alpaka_CI)" "$(env2cmake alpaka_CHECK_HEADERS)" "$(env2cmake alpaka_CXX_STANDARD)" "$(env2cmake alpaka_USE_MDSPAN)" "$(env2cmake CMAKE_INSTALL_PREFIX)" \ ".." cd .. From 74c320e7c601bf5d8ee10c5544459cc90464d3ee Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Thu, 3 Aug 2023 16:26:08 +0200 Subject: [PATCH 2/2] Add a CI run with UBSan --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6aa6a5efae8..f9e1e1bacb35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,6 +180,9 @@ jobs: - name: linux_clang-13_debug os: ubuntu-22.04 env: {CXX: clang++, CC: clang, ALPAKA_CI_CLANG_VER: 13, ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug, ALPAKA_BOOST_VERSION: 1.79.0, ALPAKA_CI_CMAKE_VER: 3.23.5, OMP_NUM_THREADS: 3, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_EXTENSIONS: OFF} + - name: linux_clang-16_debug_ubsan + os: ubuntu-latest + env: {CXX: clang++, CC: clang, ALPAKA_CI_CLANG_VER: 16, ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug, ALPAKA_BOOST_VERSION: 1.77.0, ALPAKA_CI_CMAKE_VER: 3.23.5, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:22.04", CMAKE_CXX_EXTENSIONS: OFF, ALPAKA_CI_SANITIZERS: UBSan} # icpx - name: linux_icpx_release