diff --git a/openmp/runtime/src/exports_so.txt b/openmp/runtime/src/exports_so.txt --- a/openmp/runtime/src/exports_so.txt +++ b/openmp/runtime/src/exports_so.txt @@ -122,5 +122,7 @@ } GOMP_4.0; GOMP_5.0 { } GOMP_4.5; +GOMP_5.0.1 { +} GOMP_5.0; # end of file # diff --git a/openmp/runtime/src/kmp_ftn_os.h b/openmp/runtime/src/kmp_ftn_os.h --- a/openmp/runtime/src/kmp_ftn_os.h +++ b/openmp/runtime/src/kmp_ftn_os.h @@ -712,5 +712,6 @@ #define KMP_API_NAME_GOMP_SECTIONS2_START GOMP_sections2_start #define KMP_API_NAME_GOMP_WORKSHARE_TASK_REDUCTION_UNREGISTER \ GOMP_workshare_task_reduction_unregister - +#define KMP_API_NAME_GOMP_ALLOC GOMP_alloc +#define KMP_API_NAME_GOMP_FREE GOMP_free #endif /* KMP_FTN_OS_H */ diff --git a/openmp/runtime/src/kmp_gsupport.cpp b/openmp/runtime/src/kmp_gsupport.cpp --- a/openmp/runtime/src/kmp_gsupport.cpp +++ b/openmp/runtime/src/kmp_gsupport.cpp @@ -2456,6 +2456,26 @@ } } +// allocator construct +void *KMP_EXPAND_NAME(KMP_API_NAME_GOMP_ALLOC)(size_t alignment, size_t size, + uintptr_t allocator) { + int gtid = __kmp_entry_gtid(); + KA_TRACE(20, ("GOMP_alloc: T#%d\n", gtid)); +#if OMPT_SUPPORT && OMPT_OPTIONAL + OMPT_STORE_RETURN_ADDRESS(gtid); +#endif + return __kmp_alloc(gtid, alignment, size, (omp_allocator_handle_t)allocator); +} + +void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_FREE)(void *ptr, uintptr_t allocator) { + int gtid = __kmp_entry_gtid(); + KA_TRACE(20, ("GOMP_free: T#%d\n", gtid)); +#if OMPT_SUPPORT && OMPT_OPTIONAL + OMPT_STORE_RETURN_ADDRESS(gtid); +#endif + return ___kmpc_free(gtid, ptr, (omp_allocator_handle_t)allocator); +} + /* The following sections of code create aliases for the GOMP_* functions, then create versioned symbols using the assembler directive .symver. This is only pertinent for ELF .so library. The KMP_VERSION_SYMBOL macro is defined in @@ -2644,6 +2664,10 @@ KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_SECTIONS2_START, 50, "GOMP_5.0"); KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_WORKSHARE_TASK_REDUCTION_UNREGISTER, 50, "GOMP_5.0"); + +// GOMP_5.0.1 versioned symbols +KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_ALLOC, 501, "GOMP_5.0.1"); +KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_FREE, 501, "GOMP_5.0.1"); #endif // KMP_USE_VERSION_SYMBOLS #ifdef __cplusplus