OpenMP-Examples/sources/Example_declare_target.1c.c
2015-01-13 11:38:24 -08:00

19 lines
303 B
C

/*
* @@name: declare_target.1c
* @@type: C
* @@compilable: yes
* @@linkable: no
* @@expect: success
*/
#pragma omp declare target
extern void fib(int N);
#pragma omp end declare target
#define THRESHOLD 1000000
void fib_wrapper(int n)
{
#pragma omp target if(n > THRESHOLD)
{
fib(n);
}
}