URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 273 |
Rev 338 |
#include <omp.h>
|
#include <omp.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
int l = 0;
|
int l = 0;
|
omp_nest_lock_t lock;
|
omp_nest_lock_t lock;
|
omp_init_nest_lock (&lock);
|
omp_init_nest_lock (&lock);
|
if (omp_test_nest_lock (&lock) != 1)
|
if (omp_test_nest_lock (&lock) != 1)
|
abort ();
|
abort ();
|
if (omp_test_nest_lock (&lock) != 2)
|
if (omp_test_nest_lock (&lock) != 2)
|
abort ();
|
abort ();
|
#pragma omp parallel if (0) reduction (+:l)
|
#pragma omp parallel if (0) reduction (+:l)
|
{
|
{
|
/* In OpenMP 2.5 this was supposed to return 3,
|
/* In OpenMP 2.5 this was supposed to return 3,
|
but in OpenMP 3.0 the parallel region has a different
|
but in OpenMP 3.0 the parallel region has a different
|
task and omp_*_lock_t are owned by tasks, not by threads. */
|
task and omp_*_lock_t are owned by tasks, not by threads. */
|
if (omp_test_nest_lock (&lock) != 0)
|
if (omp_test_nest_lock (&lock) != 0)
|
l++;
|
l++;
|
}
|
}
|
if (l)
|
if (l)
|
abort ();
|
abort ();
|
if (omp_test_nest_lock (&lock) != 3)
|
if (omp_test_nest_lock (&lock) != 3)
|
abort ();
|
abort ();
|
omp_unset_nest_lock (&lock);
|
omp_unset_nest_lock (&lock);
|
omp_unset_nest_lock (&lock);
|
omp_unset_nest_lock (&lock);
|
omp_unset_nest_lock (&lock);
|
omp_unset_nest_lock (&lock);
|
omp_destroy_nest_lock (&lock);
|
omp_destroy_nest_lock (&lock);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.