mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 19:03:59 +08:00
24 lines
336 B
C
24 lines
336 B
C
|
#include <omp.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
void
|
||
|
foo ()
|
||
|
{
|
||
|
{
|
||
|
#pragma omp target parallel nowait thread_limit (4) num_threads (1)
|
||
|
if (omp_get_thread_limit () > 4)
|
||
|
abort ();
|
||
|
}
|
||
|
#pragma omp taskwait
|
||
|
}
|
||
|
|
||
|
int
|
||
|
main ()
|
||
|
{
|
||
|
#pragma omp target thread_limit (6)
|
||
|
if (omp_get_thread_limit () > 6)
|
||
|
abort ();
|
||
|
foo ();
|
||
|
return 0;
|
||
|
}
|