From 37173255112ba6dcd1092883df9a13b9e5316bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Widera?= Date: Wed, 20 Dec 2023 09:48:27 +0100 Subject: [PATCH] fix icpx OpenMP atomics CI_FILTER: ^linux_icpx --- include/alpaka/atomic/AtomicOmpBuiltIn.hpp | 19 +++++++++++-------- script/install_oneapi.sh | 9 +++++++-- script/job_generator/alpaka_filter.py | 9 +++++++++ script/job_generator/versions.py | 6 +++--- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/include/alpaka/atomic/AtomicOmpBuiltIn.hpp b/include/alpaka/atomic/AtomicOmpBuiltIn.hpp index 440b373fc460..66e65b5eaac3 100644 --- a/include/alpaka/atomic/AtomicOmpBuiltIn.hpp +++ b/include/alpaka/atomic/AtomicOmpBuiltIn.hpp @@ -179,7 +179,7 @@ namespace alpaka template struct AtomicOp { - ALPAKA_FN_HOST static auto atomicOp(AtomicOmpBuiltIn const&, T* const addr, T const& value) -> T + ALPAKA_FN_HOST static auto atomicOp(AtomicOmpBuiltIn const&, T* const addr, T value) -> T { T old; auto& ref(*addr); @@ -188,7 +188,9 @@ namespace alpaka { old = ref; if(value < ref) + { ref = value; + } } return old; } @@ -198,7 +200,7 @@ namespace alpaka template struct AtomicOp { - ALPAKA_FN_HOST static auto atomicOp(AtomicOmpBuiltIn const&, T* const addr, T const& value) -> T + ALPAKA_FN_HOST static auto atomicOp(AtomicOmpBuiltIn const&, T* const addr, T value) -> T { T old; auto& ref(*addr); @@ -207,7 +209,9 @@ namespace alpaka { old = ref; if(value > ref) + { ref = value; + } } return old; } @@ -249,11 +253,7 @@ namespace alpaka template struct AtomicOp { - ALPAKA_FN_HOST static auto atomicOp( - AtomicOmpBuiltIn const&, - T* const addr, - T const& compare, - T const& value) -> T + ALPAKA_FN_HOST static auto atomicOp(AtomicOmpBuiltIn const&, T* const addr, T compare, T value) -> T { T old; auto& ref(*addr); @@ -261,7 +261,10 @@ namespace alpaka # pragma omp atomic capture compare { old = ref; - ref = (ref == compare ? value : ref); + if(ref == compare) + { + ref = value; + } } return old; } diff --git a/script/install_oneapi.sh b/script/install_oneapi.sh index 0494c1f4eeed..9d476d997b49 100755 --- a/script/install_oneapi.sh +++ b/script/install_oneapi.sh @@ -33,8 +33,13 @@ then # The compiler will automatically pull in OpenMP and TBB as dependencies components=( intel-oneapi-common-vars # Contains /opt/intel/oneapi/setvars.sh - has no version number - intel-oneapi-compiler-dpcpp-cpp-"${ALPAKA_CI_ONEAPI_VERSION}" # Contains icpx compiler and SYCL runtime - intel-oneapi-runtime-opencl # Required to run SYCL tests on the CPU - has no version number + intel-oneapi-compiler-dpcpp-cpp-"${ALPAKA_CI_ONEAPI_VERSION}" + intel-oneapi-compiler-dpcpp-cpp-runtime-"${ALPAKA_CI_ONEAPI_VERSION}" + intel-oneapi-compiler-shared-"${ALPAKA_CI_ONEAPI_VERSION}" + intel-oneapi-dpcpp-cpp-"${ALPAKA_CI_ONEAPI_VERSION}" + intel-oneapi-openmp-"${ALPAKA_CI_ONEAPI_VERSION}" + intel-oneapi-openmp-common-"${ALPAKA_CI_ONEAPI_VERSION}" + ) travis_retry sudo apt-get install -y "${components[@]}" diff --git a/script/job_generator/alpaka_filter.py b/script/job_generator/alpaka_filter.py index 71a43c1f4b70..81ce3fb8b389 100644 --- a/script/job_generator/alpaka_filter.py +++ b/script/job_generator/alpaka_filter.py @@ -55,4 +55,13 @@ def alpaka_post_filter(row: List) -> bool: ): return False + # OpenMP is not supported for ipcx < 2024 + #if row_check_name(row, HOST_COMPILER, "==", ICPX) and row_check_version(row, HOST_COMPILER, "!=", "2024.0") and ( + # row_check_backend_version(row, ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE, "==", ON_VER) + # or row_check_backend_version( + # row, ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE, "==", ON_VER + #) + #): + # return False + return True diff --git a/script/job_generator/versions.py b/script/job_generator/versions.py index d45f74d4b42d..3e0cad760d2d 100644 --- a/script/job_generator/versions.py +++ b/script/job_generator/versions.py @@ -28,7 +28,7 @@ "12.2", ], HIPCC: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5"], - ICPX: ["2023.1.0", "2023.2.0"], + ICPX: ["2024.0"], # Contains all enabled back-ends. # There are special cases for ALPAKA_ACC_GPU_CUDA_ENABLE and ALPAKA_ACC_GPU_HIP_ENABLE # which have to be combined with nvcc and hipcc versions. @@ -68,8 +68,8 @@ # Turn off OpenMP back-ends until Intel fixes https://github.com/intel/llvm/issues/10711 [ ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE, - ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE, - ALPAKA_ACC_SYCL_ENABLE, + ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE, + ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE ], ], UBUNTU: ["20.04"],