URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 38 |
Rev 154 |
extern "C" void abort (void);
|
extern "C" void abort (void);
|
|
|
main()
|
main()
|
{
|
{
|
int i, a;
|
int i, a;
|
|
|
a = 30;
|
a = 30;
|
|
|
#pragma omp parallel for firstprivate (a) lastprivate (a) \
|
#pragma omp parallel for firstprivate (a) lastprivate (a) \
|
num_threads (2) schedule(static)
|
num_threads (2) schedule(static)
|
for (i = 0; i < 10; i++)
|
for (i = 0; i < 10; i++)
|
a = a + i;
|
a = a + i;
|
|
|
/* The thread that owns the last iteration will have computed
|
/* The thread that owns the last iteration will have computed
|
30 + 5 + 6 + 7 + 8 + 9 = 65. */
|
30 + 5 + 6 + 7 + 8 + 9 = 65. */
|
if (a != 65)
|
if (a != 65)
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.