| 1 | // RUN: %libomptarget-compile-generic |
|---|---|
| 2 | // RUN: env OMP_TARGET_OFFLOAD=disabled %libomptarget-run-generic 2>&1 | %fcheck-generic |
| 3 | |
| 4 | #include <omp.h> |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | // Sanity checks to make sure that this works and is thread safe. |
| 8 | int main() { |
| 9 | // CHECK: number of devices 0 |
| 10 | printf(format: "number of devices %d\n", omp_get_num_devices()); |
| 11 | // CHECK:initial device 0 |
| 12 | printf(format: "initial device %d\n", omp_get_initial_device()); |
| 13 | // CHECK:default device 0 |
| 14 | printf(format: "default device %d\n", omp_get_default_device()); |
| 15 | // CHECK: PASS |
| 16 | if (omp_get_initial_device() == omp_get_default_device()) { |
| 17 | printf(format: "PASS\n"); |
| 18 | return 0; |
| 19 | } |
| 20 | return 1; |
| 21 | } |
| 22 |
