Patch by Michael Klemm.
Differential Revision: https://reviews.llvm.org/D74956
omp_pause_resource_all 757
omp_get_supported_active_levels 758
omp_fulfill_event 759
+ omp_display_env 733
omp_null_allocator DATA
omp_default_mem_alloc DATA
extern int __KAI_KMPC_CONVENTION omp_get_supported_active_levels(void);
+ /* OpenMP 5.1 Display Environment */
+ extern void omp_display_env(int verbose);
+
# undef __KAI_KMPC_CONVENTION
# undef __KMP_IMP
integer (kind=kmp_size_t_kind) omp_capture_affinity
end function omp_capture_affinity
+ subroutine omp_display_env(verbose) bind(c)
+ use omp_lib_kinds
+ logical (kind=omp_logical_kind), value :: verbose
+ end subroutine omp_display_env
+
! ***
! *** kmp_* entry points
! ***
integer (kind=kmp_size_t_kind) :: omp_capture_affinity
end function omp_capture_affinity
+ subroutine omp_display_env(verbose) bind(c)
+ use omp_lib_kinds
+ logical (kind=omp_logical_kind), value :: verbose
+ end subroutine omp_display_env
+
+
! ***
! *** kmp_* entry points
! ***
integer (kind=kmp_size_t_kind) :: omp_capture_affinity
end function omp_capture_affinity
+ subroutine omp_display_env(verbose) bind(c)
+ import
+ logical (kind=omp_logical_kind), value :: verbose
+ end subroutine omp_display_env
+
! ***
! *** kmp_* entry points
! ***
}
}
+extern void __kmp_omp_display_env(int verbose);
+
#ifdef __cplusplus
}
#endif
#endif
}
+// display environment variables when requested
+void FTN_STDCALL FTN_DISPLAY_ENV(int verbose) {
+#ifndef KMP_STUB
+ __kmp_omp_display_env(verbose);
+#endif
+}
+
// GCC compatibility (versioned symbols)
#ifdef KMP_USE_VERSION_SYMBOLS
#define FTN_PAUSE_RESOURCE omp_pause_resource
#define FTN_PAUSE_RESOURCE_ALL omp_pause_resource_all
#define FTN_GET_SUPPORTED_ACTIVE_LEVELS omp_get_supported_active_levels
+#define FTN_DISPLAY_ENV omp_display_env
#define FTN_FULFILL_EVENT omp_fulfill_event
#endif /* KMP_FTN_PLAIN */
#define FTN_PAUSE_RESOURCE omp_pause_resource_
#define FTN_PAUSE_RESOURCE_ALL omp_pause_resource_all_
#define FTN_GET_SUPPORTED_ACTIVE_LEVELS omp_get_supported_active_levels_
+#define FTN_DISPLAY_ENV omp_display_env_
#define FTN_FULFILL_EVENT omp_fulfill_event_
#endif /* KMP_FTN_APPEND */
#define FTN_PAUSE_RESOURCE OMP_PAUSE_RESOURCE
#define FTN_PAUSE_RESOURCE_ALL OMP_PAUSE_RESOURCE_ALL
#define FTN_GET_SUPPORTED_ACTIVE_LEVELS OMP_GET_SUPPORTED_ACTIVE_LEVELS
+#define FTN_DISPLAY_ENV OMP_DISPLAY_ENV
#define FTN_FULFILL_EVENT OMP_FULFILL_EVENT
#endif /* KMP_FTN_UPPER */
#define FTN_PAUSE_RESOURCE OMP_PAUSE_RESOURCE_
#define FTN_PAUSE_RESOURCE_ALL OMP_PAUSE_RESOURCE_ALL_
#define FTN_GET_SUPPORTED_ACTIVE_LEVELS OMP_GET_SUPPORTED_ACTIVE_LEVELS_
+#define FTN_DISPLAY_ENV OMP_DISPLAY_ENV_
#define FTN_FULFILL_EVENT OMP_FULFILL_EVENT_
#endif /* KMP_FTN_UAPPEND */
return (retval);
}
-
// this function is for testing set/get/determine reduce method
kmp_int32 __kmp_get_reduce_method(void) {
return ((__kmp_entry_thread()->th.th_local.packed_reduction_method) >> 8);
return 1;
}
}
+
+
+void __kmp_omp_display_env(int verbose) {
+ __kmp_acquire_bootstrap_lock(&__kmp_initz_lock);
+ if (__kmp_init_serial == 0)
+ __kmp_do_serial_initialize();
+ __kmp_display_env_impl(!verbose, verbose);
+ __kmp_release_bootstrap_lock(&__kmp_initz_lock);
+}
} // __kmp_env_print
void __kmp_env_print_2() {
+ __kmp_display_env_impl(__kmp_display_env, __kmp_display_env_verbose);
+} // __kmp_env_print_2
+
+void __kmp_display_env_impl(int display_env, int display_env_verbose) {
kmp_env_blk_t block;
kmp_str_buf_t buffer;
for (int i = 0; i < __kmp_stg_count; ++i) {
if (__kmp_stg_table[i].print != NULL &&
- ((__kmp_display_env &&
+ ((display_env &&
strncmp(__kmp_stg_table[i].name, "OMP_", 4) == 0) ||
- __kmp_display_env_verbose)) {
+ display_env_verbose)) {
__kmp_stg_table[i].print(&buffer, __kmp_stg_table[i].name,
__kmp_stg_table[i].data);
}
__kmp_str_buf_free(&buffer);
__kmp_printf("\n");
-
-} // __kmp_env_print_2
+}
// end of file
void __kmp_env_initialize(char const *);
void __kmp_env_print();
void __kmp_env_print_2();
+void __kmp_display_env_impl(int display_env, int display_env_verbose);
int __kmp_initial_threads_capacity(int req_nproc);
void __kmp_init_dflt_team_nth();
--- /dev/null
+// RUN: %libomp-compile-and-run 2>&1 | FileCheck %s
+// RUN: %libomp-cxx-compile-and-run 2>&1 | FileCheck %s
+#include <stdio.h>
+#include <omp.h>
+int main()
+{
+ omp_display_env(0);
+ printf("passed\n");
+ return 0;
+}
+
+// CHECK: OPENMP DISPLAY ENVIRONMENT BEGIN
+// CHECK: _OPENMP
+// CHECK: OPENMP DISPLAY ENVIRONMENT END