12 int d
= omp_get_default_device ();
13 int id
= omp_get_initial_device ();
15 if (d
< 0 || d
>= omp_get_num_devices ())
18 S s
= { 1, 2, 3, 4, 5 };
19 #pragma omp target enter data map (to:s)
23 #pragma omp target enter data map (alloc: p[:1], q[:1])
28 #pragma omp target exit data map (release: s)
31 if (!omp_target_is_present (&s
, d
))
33 if (!omp_target_is_present (&p
[0], d
))
35 if (!omp_target_is_present (&q
[0], d
))
39 #pragma omp target exit data map (from: q[:1])
42 if (omp_target_is_present (&s
, d
))
44 if (omp_target_is_present (&p
[0], d
))
46 if (omp_target_is_present (&q
[0], d
))