mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
19 lines
303 B
C
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);
|
|
}
|
|
}
|