diff options
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 29 | ||||
-rw-r--r-- | libgomp/libgomp.texi | 6 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/allocator-1.C | 13 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/allocator-2.C | 9 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/pr106445-1-O0.C | 3 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/pr106445-1.C | 18 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/pr96390.C | 2 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C | 6 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c-c++-common/pr96390.c | 2 |
9 files changed, 79 insertions, 9 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index c61c9db..096e17b 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,32 @@ +2025-04-17 Jakub Jelinek <jakub@redhat.com> + + PR libgomp/119849 + * testsuite/libgomp.c++/allocator-1.C (test_inequality, main): Guard + ompx::allocator::gnu_pinned_mem uses with #ifdef __gnu_linux__. + * testsuite/libgomp.c++/allocator-2.C (main): Likewise. + +2025-04-17 Tobias Burnus <tburnus@baylibre.com> + + * libgomp.texi (gcn interop, nvptx interop): For HIP with C/C++, add + a note about setting a preprocessor define. + +2025-04-16 Thomas Schwinge <tschwinge@baylibre.com> + + * testsuite/libgomp.c++/target-exceptions-pr118794-1.C: Remove + 'ALWAYS_INLINE' workaround. + +2025-04-16 Thomas Schwinge <tschwinge@baylibre.com> + + PR target/106445 + * testsuite/libgomp.c++/pr106445-1.C: New. + * testsuite/libgomp.c++/pr106445-1-O0.C: Likewise. + +2025-04-16 Thomas Schwinge <tschwinge@baylibre.com> + + PR target/97106 + * testsuite/libgomp.c++/pr96390.C: Un-XFAIL nvptx offloading. + * testsuite/libgomp.c-c++-common/pr96390.c: Adjust. + 2025-04-15 Tobias Burnus <tburnus@baylibre.com> * libgomp.texi (gcn, nvptx): Mention self_maps clause diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index dfd189b..6909c2b 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -6945,6 +6945,9 @@ or string (str) data type, call @code{omp_get_interop_int}, Note that @code{device_num} is the OpenMP device number while @code{device} is the HIP device number or HSA device handle. +When using HIP with C and C++, the @code{__HIP_PLATFORM_AMD__} preprocessor +macro must be defined before including the HIP header files. + For the API routine call, add the prefix @code{omp_ipr_} to the property name; for instance: @smallexample @@ -7107,6 +7110,9 @@ or string (str) data type, call @code{omp_get_interop_int}, Note that @code{device_num} is the OpenMP device number while @code{device} is the CUDA, CUDA Driver, or HIP device number. +When using HIP with C and C++, the @code{__HIP_PLATFORM_NVIDIA__} preprocessor +macro must be defined before including the HIP header files. + For the API routine call, add the prefix @code{omp_ipr_} to the property name; for instance: @smallexample diff --git a/libgomp/testsuite/libgomp.c++/allocator-1.C b/libgomp/testsuite/libgomp.c++/allocator-1.C index f820722..49425386 100644 --- a/libgomp/testsuite/libgomp.c++/allocator-1.C +++ b/libgomp/testsuite/libgomp.c++/allocator-1.C @@ -78,7 +78,10 @@ void test_inequality () CHECK_INEQUALITY (omp::allocator::cgroup_mem, void); CHECK_INEQUALITY (omp::allocator::pteam_mem, void); CHECK_INEQUALITY (omp::allocator::thread_mem, void); +#ifdef __gnu_linux__ + /* Pinning not implemented on other targets. */ CHECK_INEQUALITY (ompx::allocator::gnu_pinned_mem, void); +#endif /* And again with the same type passed to the allocator. */ CHECK_INEQUALITY (omp::allocator::null_allocator, T); CHECK_INEQUALITY (omp::allocator::default_mem, T); @@ -89,7 +92,9 @@ void test_inequality () CHECK_INEQUALITY (omp::allocator::cgroup_mem, T); CHECK_INEQUALITY (omp::allocator::pteam_mem, T); CHECK_INEQUALITY (omp::allocator::thread_mem, T); +#ifdef __gnu_linux__ CHECK_INEQUALITY (ompx::allocator::gnu_pinned_mem, T); +#endif } #undef CHECK_INEQUALITY @@ -121,7 +126,9 @@ int main () test<int, omp::allocator::cgroup_mem>(42); test<int, omp::allocator::pteam_mem>(42); test<int, omp::allocator::thread_mem>(42); +#ifdef __gnu_linux__ test<int, ompx::allocator::gnu_pinned_mem>(42); +#endif test<long long, omp::allocator::null_allocator>(42); test<long long, omp::allocator::default_mem>(42); @@ -132,7 +139,9 @@ int main () test<long long, omp::allocator::cgroup_mem>(42); test<long long, omp::allocator::pteam_mem>(42); test<long long, omp::allocator::thread_mem>(42); +#ifdef __gnu_linux__ test<long long, ompx::allocator::gnu_pinned_mem>(42); +#endif test<S, omp::allocator::null_allocator>( S{42, true, 128.f}); test<S, omp::allocator::default_mem>( S{42, true, 128.f}); @@ -143,7 +152,9 @@ int main () test<S, omp::allocator::cgroup_mem>( S{42, true, 128.f}); test<S, omp::allocator::pteam_mem>( S{42, true, 128.f}); test<S, omp::allocator::thread_mem>( S{42, true, 128.f}); +#ifdef __gnu_linux__ test<S, ompx::allocator::gnu_pinned_mem>(S{42, true, 128.f}); +#endif test_inequality<int, omp::allocator::null_allocator>(); test_inequality<int, omp::allocator::default_mem>(); @@ -154,5 +165,7 @@ int main () test_inequality<int, omp::allocator::cgroup_mem>(); test_inequality<int, omp::allocator::pteam_mem>(); test_inequality<int, omp::allocator::thread_mem>(); +#ifdef __gnu_linux__ test_inequality<int, ompx::allocator::gnu_pinned_mem>(); +#endif } diff --git a/libgomp/testsuite/libgomp.c++/allocator-2.C b/libgomp/testsuite/libgomp.c++/allocator-2.C index d25b755..ca94fc7 100644 --- a/libgomp/testsuite/libgomp.c++/allocator-2.C +++ b/libgomp/testsuite/libgomp.c++/allocator-2.C @@ -86,7 +86,10 @@ int main () f<int, omp::allocator::cgroup_mem >(0, 1, 2, 3); f<int, omp::allocator::pteam_mem >(0, 1, 2, 3); f<int, omp::allocator::thread_mem >(0, 1, 2, 3); +#ifdef __gnu_linux__ + /* Pinning not implemented on other targets. */ f<int, ompx::allocator::gnu_pinned_mem>(0, 1, 2, 3); +#endif f<long long, omp::allocator::null_allocator >(0, 1, 2, 3); f<long long, omp::allocator::default_mem >(0, 1, 2, 3); @@ -97,7 +100,9 @@ int main () f<long long, omp::allocator::cgroup_mem >(0, 1, 2, 3); f<long long, omp::allocator::pteam_mem >(0, 1, 2, 3); f<long long, omp::allocator::thread_mem >(0, 1, 2, 3); +#ifdef __gnu_linux__ f<long long, ompx::allocator::gnu_pinned_mem>(0, 1, 2, 3); +#endif S0 s0_0{ 42, true, 111128.f}; S0 s0_1{ 142, false, 11128.f}; @@ -112,7 +117,9 @@ int main () f<S0, omp::allocator::cgroup_mem >(s0_0, s0_1, s0_2, s0_3); f<S0, omp::allocator::pteam_mem >(s0_0, s0_1, s0_2, s0_3); f<S0, omp::allocator::thread_mem >(s0_0, s0_1, s0_2, s0_3); +#ifdef __gnu_linux__ f<S0, ompx::allocator::gnu_pinned_mem>(s0_0, s0_1, s0_2, s0_3); +#endif S1 s1_0{ 42, true, 111128.f}; S1 s1_1{ 142, false, 11128.f}; @@ -128,5 +135,7 @@ int main () f<S1, omp::allocator::cgroup_mem >(s1_0, s1_1, s1_2, s1_3); f<S1, omp::allocator::pteam_mem >(s1_0, s1_1, s1_2, s1_3); f<S1, omp::allocator::thread_mem >(s1_0, s1_1, s1_2, s1_3); +#ifdef __gnu_linux__ f<S1, ompx::allocator::gnu_pinned_mem>(s1_0, s1_1, s1_2, s1_3); +#endif } diff --git a/libgomp/testsuite/libgomp.c++/pr106445-1-O0.C b/libgomp/testsuite/libgomp.c++/pr106445-1-O0.C new file mode 100644 index 0000000..bcd499c --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/pr106445-1-O0.C @@ -0,0 +1,3 @@ +// { dg-additional-options -O0 } + +#include "pr106445-1.C" diff --git a/libgomp/testsuite/libgomp.c++/pr106445-1.C b/libgomp/testsuite/libgomp.c++/pr106445-1.C new file mode 100644 index 0000000..329ce62 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/pr106445-1.C @@ -0,0 +1,18 @@ +#include <vector> + +int main() +{ +#pragma omp target + { + { + std::vector<int> v; + if (!v.empty()) + __builtin_abort(); + } + { + std::vector<int> v(100); + if (v.capacity() < 100) + __builtin_abort(); + } + } +} diff --git a/libgomp/testsuite/libgomp.c++/pr96390.C b/libgomp/testsuite/libgomp.c++/pr96390.C index 1f3c3e0..be19601 100644 --- a/libgomp/testsuite/libgomp.c++/pr96390.C +++ b/libgomp/testsuite/libgomp.c++/pr96390.C @@ -1,6 +1,4 @@ /* { dg-additional-options "-O0 -fdump-tree-omplower" } */ -/* { dg-additional-options "-foffload=-Wa,--verify" { target offload_target_nvptx } } */ -/* { dg-xfail-if "PR 97106/PR 97102 - .alias not (yet) supported for nvptx" { offload_target_nvptx } } */ #include <cstdlib> #include <type_traits> diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C index a73e7f8..24e3d07 100644 --- a/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C +++ b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C @@ -9,10 +9,6 @@ /* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-pr118794-1.C', '../../../gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1.C'. */ -/* Help nvptx offloading overcome a code generation issue; - PR106445, PR118518. */ -#define ALWAYS_INLINE __attribute__((always_inline)) - #pragma omp begin declare target bool ok = false; @@ -20,12 +16,10 @@ bool ok = false; template <typename T> struct C { - ALWAYS_INLINE C() { ok = true; } - ALWAYS_INLINE C(int) {}; ~C() {}; diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr96390.c b/libgomp/testsuite/libgomp.c-c++-common/pr96390.c index b89f934..ca7865d 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/pr96390.c +++ b/libgomp/testsuite/libgomp.c-c++-common/pr96390.c @@ -1,7 +1,7 @@ /* { dg-additional-options "-O0 -fdump-tree-omplower" } */ /* { dg-additional-options "-foffload=-Wa,--verify" { target offload_target_nvptx } } */ /* { dg-require-alias "" } */ -/* { dg-xfail-if "PR 97102/PR 97106 - .alias not (yet) supported for nvptx" { offload_target_nvptx } } */ +/* { dg-xfail-if PR105018 { offload_target_nvptx } } */ #ifdef __cplusplus extern "C" { |