We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afd4f7e commit e67cbb8Copy full SHA for e67cbb8
offload/test/offloading/disable_default_device.c
@@ -0,0 +1,22 @@
1
+// RUN: %libomptarget-compile-generic
2
+// RUN: env OMP_TARGET_OFFLOAD=disabled %libomptarget-run-generic 2>&1 |
3
+// %fcheck-generic
4
+
5
+#include <omp.h>
6
+#include <stdio.h>
7
8
+// Sanity checks to make sure that this works and is thread safe.
9
+int main() {
10
+ // CHECK: number of devices 0
11
+ printf("number of devices %d\n", omp_get_num_devices());
12
+ // CHECK:initial device 0
13
+ printf("initial device %d\n", omp_get_initial_device());
14
+ // CHECK:default device 0
15
+ printf("default device %d\n", omp_get_default_device());
16
+ // CHECK: PASS
17
+ if (omp_get_initial_device() == omp_get_default_device()) {
18
+ printf("PASS\n");
19
+ return 0;
20
+ }
21
+ return 1;
22
+}
0 commit comments