aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog4
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c58
2 files changed, 51 insertions, 11 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 9631838..f1817e9 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,7 @@
+2025-05-05 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c/interop-hsa.c: GCN offloading only.
+
2025-05-01 Tobias Burnus <tobias@codesourcery.com>
* testsuite/libgomp.fortran/allocate-8a.f90: New test.
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c b/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c
index 03d93cc..02e02dc 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c
@@ -9,8 +9,8 @@
void __attribute__ ((noipa))
parallel_reduction ()
{
- int a[8] = {1 ,1, 1, 1, 1, 1, 1, 1};
- int b[8] = {0 ,0, 0, 0, 0, 0, 0, 0};
+ int a[8] = {1, 1, 1, 1, 1, 1, 1, 1};
+ int b[8] = {0, 0, 0, 0, 0, 0, 0, 0};
svint32_t va = svld1_s32 (svptrue_b32 (), b);
int i = 0;
int64_t res;
@@ -30,8 +30,8 @@ parallel_reduction ()
void __attribute__ ((noipa))
for_reduction ()
{
- int a[8] = {1 ,1, 1, 1, 1, 1, 1, 1};
- int b[8] = {0 ,0, 0, 0, 0, 0, 0, 0};
+ int a[8] = {1, 1, 1, 1, 1, 1, 1, 1};
+ int b[8] = {0, 0, 0, 0, 0, 0, 0, 0};
svint32_t va = svld1_s32 (svptrue_b32 (), b);
int j;
int64_t res;
@@ -58,13 +58,13 @@ simd_reduction ()
for (j = 0; j < 8; j++)
a[j] = 1;
- #pragma omp simd reduction (+:va, i)
+ #pragma omp simd reduction (+:va)
for (j = 0; j < 16; j++)
- va = svld1_s32 (svptrue_b32 (), a);
+ va += svld1_s32 (svptrue_b32 (), a);
res = svaddv_s32 (svptrue_b32 (), va);
- if (res != 8)
+ if (res != 128)
__builtin_abort ();
}
@@ -72,22 +72,57 @@ void __attribute__ ((noipa))
inscan_reduction_incl ()
{
svint32_t va = svindex_s32 (0, 0);
+ int a[8] = {1, 1, 1, 1, 1, 1, 1, 1};
+ int b[64] = { 0 };
int j;
int64_t res = 0;
- #pragma omp parallel
- #pragma omp for reduction (inscan,+:va) firstprivate (res) lastprivate (res)
+ #pragma omp parallel for reduction (inscan, +:va)
for (j = 0; j < 8; j++)
{
- va = svindex_s32 (1, 0);
+ va += svld1_s32 (svptrue_b32 (), a);
#pragma omp scan inclusive (va)
- res += svaddv_s32 (svptrue_b32 (), va);
+ svst1_s32 (svptrue_b32 (), b + j * 8, va);
+ }
+
+ res = svaddv_s32 (svptrue_b32 (), va);
+
+ if (res != 64)
+ __builtin_abort ();
+
+ for (j = 0; j < 64; j+=8)
+ if (b[j] != (j / 8 + 1))
+ __builtin_abort ();
+}
+
+void __attribute__ ((noipa))
+inscan_reduction_excl ()
+{
+ svint32_t va = svindex_s32 (0, 0);
+ int a[8] = {1, 1, 1, 1, 1, 1, 1, 1};
+ int b[64] = { 0 };
+ int j;
+ int64_t res = 0;
+
+ #pragma omp parallel for reduction (inscan, +:va)
+ for (j = 0; j < 8; j++)
+ {
+ svst1_s32 (svptrue_b32 (), b + j * 8, va);
+ #pragma omp scan exclusive (va)
+ va += svld1_s32 (svptrue_b32 (), a);
}
+ res = svaddv_s32 (svptrue_b32 (), va);
+
if (res != 64)
__builtin_abort ();
+
+ for (j = 0; j < 64; j+=8)
+ if (b[j] != j / 8)
+ __builtin_abort ();
}
+
int
main ()
{
@@ -95,4 +130,5 @@ main ()
for_reduction ();
simd_reduction ();
inscan_reduction_incl ();
+ inscan_reduction_excl ();
}