OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [ordered-3.c] - Rev 273

Compare with Previous | Blame | View Log

#include <stdlib.h>
 
int cnt;
 
void
check (int x)
{
  if (cnt++ != x)
    abort ();
}
 
int
main (void)
{
  int j;
 
  cnt = 0;
#pragma omp parallel for ordered schedule (static, 1) num_threads (4) if (0)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (static, 1) num_threads (4) if (1)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (runtime) num_threads (4) if (0)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (runtime) num_threads (4) if (1)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (dynamic) num_threads (4) if (0)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (dynamic) num_threads (4) if (1)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (guided) num_threads (4) if (0)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  cnt = 0;
#pragma omp parallel for ordered schedule (guided) num_threads (4) if (1)
  for (j = 0; j < 1000; j++)
    {
#pragma omp ordered
      check (j);
    }
 
  return 0;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.