diff --git a/openmp/runtime/src/include/omp.h.var b/openmp/runtime/src/include/omp.h.var --- a/openmp/runtime/src/include/omp.h.var +++ b/openmp/runtime/src/include/omp.h.var @@ -468,6 +468,15 @@ /* OpenMP 5.1 Display Environment */ extern void omp_display_env(int verbose); +# if defined(_OPENMP) && _OPENMP >= 201811 + #pragma omp begin declare variant match(device={kind(host)}) + static int omp_is_initial_device(void) { return 1; } + #pragma omp end declare variant + #pragma omp begin declare variant match(device={kind(nohost)}) + static int omp_is_initial_device(void) { return 0; } + #pragma omp end declare variant +# endif + # undef __KAI_KMPC_CONVENTION # undef __KMP_IMP