LLVM OpenMP
omp_num_threads_warnings_off.c
Go to the documentation of this file.
1// RUN: %libomp-compile
2// RUN: env KMP_WARNINGS=0 OMP_NUM_THREADS_DEV_abc=10 \
3// RUN: OMP_DEFAULT_DEVICE_ALL=2 OMP_NUM_THREADS_ALL=8 \
4// RUN: %libomp-run 2>&1 | FileCheck %s
5//
6// KMP_WARNINGS=0 silences device-scope warnings; OMP_NUM_THREADS_ALL=8 applies.
7
8#include <omp.h>
9#include <stdio.h>
10
11int main(void) {
12 int max = omp_get_max_threads();
13 if (max != 8) {
14 fprintf(stderr, "FAIL: omp_get_max_threads()=%d, expected 8\n", max);
15 return 1;
16 }
17 printf("DONE\n");
18 return 0;
19}
20
21// CHECK-NOT: {{^OMP: Warning #[0-9]+:.*OMP_NUM_THREADS_DEV_abc.*}}
22// CHECK-NOT: {{^OMP: Warning #[0-9]+:.*OMP_DEFAULT_DEVICE_ALL.*}}
23// CHECK: DONE
int main(void)
int omp_get_max_threads()