view libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-reduction-1.c @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* Verify that a simple, explicit acc loop reduction works inside
 a kernels region.  */

#include <stdlib.h>

#define N 100

int
main ()
{
  int i, red = 0;

#pragma acc kernels
  {
#pragma acc loop reduction (+:red)
  for (i = 0; i < N; i++)
    red++;
  }

  if (red != N)
    abort ();

  return 0;
}