9390f91687
Before the commit "[libgomp, testsuite, openacc] Don't use const int for dimensions", the "const int" construct was used to set launch dimensions in reductions-[1-5].c. In the case of -xc -O0, the const int is implemented as a variable by the C front-end. Consequently, the nvptx back-end generated warnings that vector_length was overridden to be hard-coded, rather than left to be set at runtime. The test-cases silenced these warnings by switching off all warnings in the accelerator compiler using "-foffload=-w". Given that no warnings occur anymore, remove the "-foffload=-w" setting. 2019-01-11 Tom de Vries <tdevries@suse.de> * testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Remove -foffload=-w. * testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Same. * testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Same. * testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Same. * testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Same. From-SVN: r267836
54 lines
1.3 KiB
C
54 lines
1.3 KiB
C
/* { dg-do run { target { ! { hppa*-*-hpux* } } } } */
|
|
|
|
/* complex reductions. */
|
|
|
|
#include <stdlib.h>
|
|
#include <complex.h>
|
|
#include "reduction.h"
|
|
|
|
#define ng 8
|
|
#define nw 4
|
|
#define vl 32
|
|
|
|
static void
|
|
test_reductions (void)
|
|
{
|
|
const int n = 10;
|
|
int i;
|
|
double _Complex array[n];
|
|
|
|
for (i = 0; i < n; i++)
|
|
array[i] = i+1;
|
|
|
|
/* Gang reductions. */
|
|
check_reduction_op (double, +, 0, creal (array[i]), num_gangs (ng), gang);
|
|
check_reduction_op (double, *, 1, creal (array[i]), num_gangs (ng), gang);
|
|
|
|
/* Worker reductions. */
|
|
check_reduction_op (double, +, 0, creal (array[i]), num_workers (nw),
|
|
worker);
|
|
check_reduction_op (double, *, 1, creal (array[i]), num_workers (nw),
|
|
worker);
|
|
|
|
/* Vector reductions. */
|
|
check_reduction_op (double, +, 0, creal (array[i]), vector_length (vl),
|
|
vector);
|
|
check_reduction_op (double, *, 1, creal (array[i]), vector_length (vl),
|
|
vector);
|
|
|
|
/* Combined reductions. */
|
|
check_reduction_op (double, +, 0, creal (array[i]), num_gangs (ng)
|
|
num_workers (nw) vector_length (vl), gang worker
|
|
vector);
|
|
check_reduction_op (double, *, 1, creal (array[i]), num_gangs (ng)
|
|
num_workers (nw) vector_length (vl), gang worker
|
|
vector);
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
test_reductions ();
|
|
return 0;
|
|
}
|