@@ -5,6 +5,13 @@
#include <assert.h>
#include <stdio.h>
+#if ACC_DEVICE_TYPE_nvidia
+/* To avoid 'libgomp: The Nvidia accelerator has insufficient resources'. */
+#define NUM_WORKERS 28
+#else
+#define NUM_WORKERS 32
+#endif
+
#define LOCAL(n) double n = input;
#define LOCALS(n) LOCAL(n##1) LOCAL(n##2) LOCAL(n##3) LOCAL(n##4) \
LOCAL(n##5) LOCAL(n##6) LOCAL(n##7) LOCAL(n##8)
@@ -23,7 +30,7 @@ int main (void)
int ret;
int input = 1;
- #pragma acc parallel num_gangs(1) num_workers(32) copyout(ret)
+ #pragma acc parallel num_gangs(1) num_workers(NUM_WORKERS) copyout(ret)
{
int w = 0;
LOCALS2(h);
@@ -1,5 +1,12 @@
#include <assert.h>
+#if ACC_DEVICE_TYPE_nvidia
+/* To avoid 'libgomp: The Nvidia accelerator has insufficient resources'. */
+#define NUM_WORKERS 24
+#else
+#define NUM_WORKERS 32
+#endif
+
/* Test of reduction on both parallel and loop directives (workers and vectors
together in gang-partitioned mode, float type, multiple reductions). */
@@ -13,7 +20,8 @@ main (int argc, char *argv[])
for (i = 0; i < 32768; i++)
arr[i] = i % (32768 / 64);
- #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
+ #pragma acc parallel \
+ num_gangs(32) num_workers(NUM_WORKERS) vector_length(32) \
reduction(+:res) reduction(max:mres) copy(res, mres)
{
#pragma acc loop gang /* { dg-warning "nested loop in reduction needs reduction clause for 'm\?res'" "TODO" } */
@@ -181,6 +181,12 @@ void gwv_np_3()
assert (res == hres);
}
+#if ACC_DEVICE_TYPE_nvidia
+/* To avoid 'libgomp: The Nvidia accelerator has insufficient resources'. */
+#define NUM_WORKERS 28
+#else
+#define NUM_WORKERS 32
+#endif
/* Test of reduction on loop directive (gangs, workers and vectors, multiple
non-private reduction variables, float type). */
@@ -194,7 +200,7 @@ void gwv_np_4()
for (i = 0; i < 32768; i++)
arr[i] = i % (32768 / 64);
- #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32)
+ #pragma acc parallel num_gangs(32) num_workers(NUM_WORKERS) vector_length(32)
{
#pragma acc loop gang reduction(+:res) reduction(max:mres)
for (j = 0; j < 32; j++)
@@ -235,6 +241,7 @@ void gwv_np_4()
assert (mres == hmres);
}
+#undef NUM_WORKERS
/* Test of reduction on loop directive (vectors, private reduction
variable). */