diff --git a/ChangeLog.md b/ChangeLog.md index d0c806ef1ff0d..cfef44a19b163 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -23,6 +23,7 @@ See docs/process.md for more on how version tagging works. - Revert #27397, which changed the way config keys such as NODE_JS were parsed when reading the config file. This change broke emsdk installations that contained spaces. (#27421) +- OpenMP was updated to LLVM 22.1.8 (#27437) 6.0.4 - 07/24/26 ---------------- diff --git a/system/lib/openmp/README.md b/system/lib/openmp/README.md index 4bed6032202e4..17b5e78f6be4a 100644 --- a/system/lib/openmp/README.md +++ b/system/lib/openmp/README.md @@ -1,17 +1,14 @@ llvm's OpenMP ------------- -Note: This version of openmp is actually based on 1823581ecb but -we are in the process of updating it. - -These files are from the llvm-project based on release 21.1.8. +These files are from the llvm-project based on release 22.1.8. We maintain a local fork of llvm-project that contains any Emscripten specific patches: https://github.com/emscripten-core/llvm-project -The current patch is based on the emscripten-libs-21 branch. +The current patch is based on the emscripten-libs-22 branch. Update Instructions ------------------- @@ -23,4 +20,4 @@ Modifications For a list of changes from upstream see the OpenMP files that are part of: -https://github.com/llvm/llvm-project/compare/llvmorg-21.1.8...emscripten-core:emscripten-libs-21 +https://github.com/llvm/llvm-project/compare/llvmorg-22.1.8...emscripten-core:emscripten-libs-22 diff --git a/system/lib/openmp/include/omp.h b/system/lib/openmp/include/omp.h index 2ca594d5f44f4..cc9bd453f5b9a 100644 --- a/system/lib/openmp/include/omp.h +++ b/system/lib/openmp/include/omp.h @@ -380,11 +380,6 @@ omp_uintptr_t value; } omp_alloctrait_t; - typedef enum { - omp_access_cgroup = 0, - omp_access_pteam = 1 - } omp_access_t; - # if defined(_WIN32) // On Windows cl and icl do not support 64-bit enum, let's use integer then. typedef omp_uintptr_t omp_allocator_handle_t; @@ -408,7 +403,6 @@ extern __KMP_IMP omp_memspace_handle_t const omp_const_mem_space; extern __KMP_IMP omp_memspace_handle_t const omp_high_bw_mem_space; extern __KMP_IMP omp_memspace_handle_t const omp_low_lat_mem_space; - extern __KMP_IMP omp_memspace_handle_t const omp_cgroup_mem_space; extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_host_mem_space; extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_shared_mem_space; extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_device_mem_space; @@ -445,7 +439,6 @@ omp_const_mem_space = 2, omp_high_bw_mem_space = 3, omp_low_lat_mem_space = 4, - omp_cgroup_mem_space = 5, llvm_omp_target_host_mem_space = 100, llvm_omp_target_shared_mem_space = 101, llvm_omp_target_device_mem_space = 102, @@ -470,11 +463,6 @@ omp_allocator_handle_t allocator = omp_null_allocator, omp_allocator_handle_t free_allocator = omp_null_allocator); extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, omp_allocator_handle_t a = omp_null_allocator); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_ptr(size_t offset = 0, omp_access_t access_group = omp_access_cgroup); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_nofb_ptr(size_t offset = 0, omp_access_t access_group = omp_access_cgroup); - extern size_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_size(omp_access_t access_group = omp_access_cgroup); - extern omp_memspace_handle_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_memspace(omp_access_t access_group = omp_access_cgroup); - extern size_t __KAI_KMPC_CONVENTION omp_get_gprivate_limit(int device_num, omp_access_t access_group = omp_access_cgroup); # else extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a); extern void *__KAI_KMPC_CONVENTION omp_aligned_alloc(size_t align, size_t size, @@ -485,11 +473,6 @@ extern void *__KAI_KMPC_CONVENTION omp_realloc(void *ptr, size_t size, omp_allocator_handle_t allocator, omp_allocator_handle_t free_allocator); extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_ptr(size_t offset, omp_access_t access_group); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_nofb_ptr(size_t offset, omp_access_t access_group); - extern size_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_size(omp_access_t access_group); - extern omp_memspace_handle_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_memspace(omp_access_t access_group); - extern size_t __KAI_KMPC_CONVENTION omp_get_gprivate_limit(int device_num, omp_access_t access_group); # endif /* OpenMP TR11 routines to get memory spaces and allocators */ @@ -553,7 +536,6 @@ /* OpenMP 5.2 */ extern int __KAI_KMPC_CONVENTION omp_in_explicit_task(void); - #define omp_initial_device -1 #define omp_invalid_device -2 /* OpenMP 6.0 */ diff --git a/system/lib/openmp/include/ompx.h b/system/lib/openmp/include/ompx.h index a79ec34b81fa2..6884745f4240c 100644 --- a/system/lib/openmp/include/ompx.h +++ b/system/lib/openmp/include/ompx.h @@ -9,7 +9,7 @@ #ifndef __OMPX_H #define __OMPX_H -#if (defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__)) +#if (defined(__NVPTX__) || defined(__AMDGPU__)) #include #define __OMPX_TARGET_IS_GPU #endif diff --git a/system/lib/openmp/prebuilt/kmp_config.h b/system/lib/openmp/prebuilt/kmp_config.h index d9ed6d9c6cbe5..ee950055d2703 100644 --- a/system/lib/openmp/prebuilt/kmp_config.h +++ b/system/lib/openmp/prebuilt/kmp_config.h @@ -46,8 +46,8 @@ #define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT #define LIBOMP_OMPD_SUPPORT 0 #define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT -#define LIBOMP_TASKGRAPH_EXPERIMENTAL 0 -#define OMP_TASKGRAPH_EXPERIMENTAL LIBOMP_TASKGRAPH_EXPERIMENTAL +#define LIBOMP_OMPX_TASKGRAPH 0 +#define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH #define LIBOMP_PROFILING_SUPPORT 0 #define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT #define LIBOMP_OMPT_OPTIONAL 1 @@ -96,8 +96,6 @@ #define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN #define LIBOMP_HAVE__ALIGNED_MALLOC 0 #define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC -#define LIBOMP_USE_CANCEL_THREADS 1 -#define KMP_CANCEL_THREADS LIBOMP_USE_CANCEL_THREADS #define OPENMP_ENABLE_LIBOMPTARGET 0 #define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET diff --git a/system/lib/openmp/prebuilt/kmp_i18n_default.inc b/system/lib/openmp/prebuilt/kmp_i18n_default.inc index 302d3dea9f354..dbfad2c528eaf 100644 --- a/system/lib/openmp/prebuilt/kmp_i18n_default.inc +++ b/system/lib/openmp/prebuilt/kmp_i18n_default.inc @@ -417,8 +417,6 @@ __kmp_i18n_default_messages[] = "Target memory not available, will use default allocator.", "%1$s ignored: This machine is not a hybrid architecutre. Using \"%2$s\" instead.", "%1$s ignored: %2$s is not available. Using \"%3$s\" instead.", - "%1$s() called inside a parallel or teams region; call ignored.", - "%1$s() called inside a parallel or teams region; call ignored.", NULL }; @@ -471,7 +469,7 @@ __kmp_i18n_sections[] = { 5, __kmp_i18n_default_meta }, { 79, __kmp_i18n_default_strings }, { 6, __kmp_i18n_default_formats }, - { 303, __kmp_i18n_default_messages }, + { 301, __kmp_i18n_default_messages }, { 29, __kmp_i18n_default_hints }, { 0, NULL } }; diff --git a/system/lib/openmp/prebuilt/kmp_i18n_id.inc b/system/lib/openmp/prebuilt/kmp_i18n_id.inc index 4a337fc8c8d28..5316321d0a602 100644 --- a/system/lib/openmp/prebuilt/kmp_i18n_id.inc +++ b/system/lib/openmp/prebuilt/kmp_i18n_id.inc @@ -411,8 +411,6 @@ enum kmp_i18n_id { kmp_i18n_msg_TargetMemNotAvailable, kmp_i18n_msg_AffIgnoringNonHybrid, kmp_i18n_msg_AffIgnoringNotAvailable, - kmp_i18n_msg_SetNumTeamsInParOrTeamsRegion, - kmp_i18n_msg_SetTeamsThreadLimitInParOrTeamsRegion, kmp_i18n_msg_last, // Set #5, hints. diff --git a/system/lib/openmp/src/CMakeLists.txt b/system/lib/openmp/src/CMakeLists.txt index f8b9260af8c17..81fa9f0f2aaf8 100644 --- a/system/lib/openmp/src/CMakeLists.txt +++ b/system/lib/openmp/src/CMakeLists.txt @@ -22,7 +22,7 @@ endif() configure_file(${LIBOMP_INC_DIR}/omp.h.var ${LIBOMP_HEADERS_INTDIR}/omp.h @ONLY) configure_file(${LIBOMP_INC_DIR}/ompx.h.var ${LIBOMP_HEADERS_INTDIR}/ompx.h @ONLY) configure_file(kmp_config.h.cmake kmp_config.h @ONLY) -if(LIBOMP_OMPT_SUPPORT) +if(${LIBOMP_OMPT_SUPPORT}) configure_file(${LIBOMP_INC_DIR}/omp-tools.h.var ${LIBOMP_HEADERS_INTDIR}/omp-tools.h @ONLY) endif() @@ -81,13 +81,11 @@ if(STUBS_LIBRARY) else() # Get C++ files set(LIBOMP_CXXFILES - kmp_adt.cpp kmp_alloc.cpp kmp_atomic.cpp kmp_csupport.cpp kmp_debug.cpp kmp_itt.cpp - kmp_invoke_microtask.cpp kmp_environment.cpp kmp_error.cpp kmp_global.cpp @@ -111,9 +109,9 @@ else() # Windows specific files libomp_append(LIBOMP_CXXFILES z_Windows_NT_util.cpp) libomp_append(LIBOMP_CXXFILES z_Windows_NT-586_util.cpp) - if(LIBOMP_ARCH STREQUAL "i386" OR LIBOMP_ARCH STREQUAL "x86_64") + if(${LIBOMP_ARCH} STREQUAL "i386" OR ${LIBOMP_ARCH} STREQUAL "x86_64") libomp_append(LIBOMP_ASMFILES z_Windows_NT-586_asm.asm) # Windows assembly file - elseif((LIBOMP_ARCH STREQUAL "aarch64" OR LIBOMP_ARCH STREQUAL "arm") AND (NOT MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")) + elseif((${LIBOMP_ARCH} STREQUAL "aarch64" OR ${LIBOMP_ARCH} STREQUAL "arm") AND (NOT MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")) # z_Linux_asm.S works for AArch64 and ARM Windows too. libomp_append(LIBOMP_GNUASMFILES z_Linux_asm.S) else() @@ -176,7 +174,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS) # Build libomp library. Add LLVMSupport dependency if building in-tree with # libomptarget profiling enabled. -if(NOT OPENMP_ENABLE_LIBOMP_PROFILING) +if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING)) add_library(omp ${LIBOMP_LIBRARY_KIND} $) set_property(TARGET omp PROPERTY FOLDER "OpenMP/Libraries") # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS @@ -190,10 +188,7 @@ else() # libomp must be a C++ library such that it can link libLLVMSupport set(LIBOMP_LINKER_LANGUAGE CXX) endif() - -openmp_register_meta_dep(omp) - -if(LIBOMP_USE_HWLOC) +if(${LIBOMP_USE_HWLOC}) # Since we are using an OBJECT library, the PRIVATE and INTERFACE options are split # (instead of using PUBLIC): obj.omp for compiling itself, omp for propagating # the options to other libraries that depend on it, e.g. libompd. @@ -385,7 +380,7 @@ if(WIN32) endif() # Move files to exports/ directory if requested -if(LIBOMP_COPY_EXPORTS) +if(${LIBOMP_COPY_EXPORTS}) include(LibompExports) endif() @@ -393,7 +388,7 @@ endif() include(LibompMicroTests) add_custom_target(libomp-micro-tests) set_target_properties(libomp-micro-tests PROPERTIES FOLDER "OpenMP/Tests") -if(NOT MIC AND NOT CMAKE_CROSSCOMPILING) +if(NOT ${MIC} AND NOT CMAKE_CROSSCOMPILING) add_dependencies(libomp-micro-tests libomp-test-touch) endif() if(NOT WIN32 AND NOT APPLE) @@ -406,29 +401,31 @@ add_dependencies(libomp-micro-tests libomp-test-deps) # `omp` needs to be exported if in-tree build. set(export_to_llvmexports) -get_target_export_arg(omp LLVM export_to_llvmexports) -set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp) +if (NOT OPENMP_STANDALONE_BUILD) + get_target_export_arg(omp LLVM export_to_llvmexports) + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp) +endif() # Install rules # We want to install libomp in ${DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR} # We want to install headers in ${DESTDIR}/${CMAKE_INSTALL_FULL_INCLUDEDIR} if(WIN32) - install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT openmp) - install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT openmp) + install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") # Create aliases (regular copies) of the library for backwards compatibility set(LIBOMP_ALIASES "libiomp5md") foreach(alias IN LISTS LIBOMP_ALIASES) install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\" - \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${CMAKE_INSTALL_FULL_BINDIR}\")" COMPONENT openmp) + \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${CMAKE_INSTALL_FULL_BINDIR}\")") extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}") install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\" - \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${outdir}\")" COMPONENT openmp) + \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${outdir}\")") endforeach() else() - install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT openmp) + install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}") - if(LIBOMP_INSTALL_ALIASES) + if(${LIBOMP_INSTALL_ALIASES}) # Create aliases (symlinks) of the library for backwards compatibility extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}") if(AIX) @@ -441,12 +438,12 @@ else() foreach(alias IN LISTS LIBOMP_ALIASES) install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_NAME}${LIBRARY_SUFFIX}\" \"${alias}${LIBRARY_SUFFIX}\" WORKING_DIRECTORY - \"\$ENV{DESTDIR}${outdir}\")" COMPONENT openmp) + \"\$ENV{DESTDIR}${outdir}\")") endforeach() if(LIBOMP_ENABLE_SHARED AND NOT AIX) install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\" \"${VERSIONED_LIBGOMP_NAME}\" WORKING_DIRECTORY - \"\$ENV{DESTDIR}${outdir}\")" COMPONENT openmp) + \"\$ENV{DESTDIR}${outdir}\")") endif() endif() endif() @@ -455,11 +452,10 @@ install( ${LIBOMP_HEADERS_INTDIR}/omp.h ${LIBOMP_HEADERS_INTDIR}/ompx.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} - COMPONENT openmp ) -if(LIBOMP_OMPT_SUPPORT) - install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} COMPONENT openmp) +if(${LIBOMP_OMPT_SUPPORT}) + install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}) # install under legacy name ompt.h - install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h COMPONENT openmp) + install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h) set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) endif() diff --git a/system/lib/openmp/src/dllexports b/system/lib/openmp/src/dllexports index 8a70f8bc6d20c..00becd1a657fd 100644 --- a/system/lib/openmp/src/dllexports +++ b/system/lib/openmp/src/dllexports @@ -607,7 +607,6 @@ kmp_set_disp_num_buffers 890 llvm_omp_target_shared_mem_space DATA llvm_omp_target_device_mem_space DATA omp_null_mem_space DATA - omp_cgroup_mem_space DATA %ifndef stub # Ordinals between 900 and 999 are reserved diff --git a/system/lib/openmp/src/i18n/en_US.txt b/system/lib/openmp/src/i18n/en_US.txt index b3699df6db65d..08e837d3dea11 100644 --- a/system/lib/openmp/src/i18n/en_US.txt +++ b/system/lib/openmp/src/i18n/en_US.txt @@ -482,8 +482,6 @@ AffHWSubsetIgnoringAttr "KMP_HW_SUBSET: ignoring %1$s attribute. This machi TargetMemNotAvailable "Target memory not available, will use default allocator." AffIgnoringNonHybrid "%1$s ignored: This machine is not a hybrid architecutre. Using \"%2$s\" instead." AffIgnoringNotAvailable "%1$s ignored: %2$s is not available. Using \"%3$s\" instead." -SetNumTeamsInParOrTeamsRegion "%1$s() called inside a parallel or teams region; call ignored." -SetTeamsThreadLimitInParOrTeamsRegion "%1$s() called inside a parallel or teams region; call ignored." # -------------------------------------------------------------------------------------------------- -*- HINTS -*- diff --git a/system/lib/openmp/src/include/omp-tools.h.var b/system/lib/openmp/src/include/omp-tools.h.var index af9213a7290e7..471f46a9073ee 100644 --- a/system/lib/openmp/src/include/omp-tools.h.var +++ b/system/lib/openmp/src/include/omp-tools.h.var @@ -23,14 +23,11 @@ #ifdef DEPRECATION_WARNINGS # ifdef __cplusplus # define DEPRECATED_51 [[deprecated("as of 5.1")]] -# define DEPRECATED_60 [[deprecated("as of 6.0")]] # else # define DEPRECATED_51 __attribute__((deprecated("as of 5.1"))) -# define DEPRECATED_60 __attribute__((deprecated("as of 6.0"))) #endif #else #define DEPRECATED_51 -#define DEPRECATED_60 #endif /***************************************************************************** @@ -72,8 +69,6 @@ macro (ompt_state_work_serial, 0x000) /* working outside parallel */ \ macro (ompt_state_work_parallel, 0x001) /* working within parallel */ \ macro (ompt_state_work_reduction, 0x002) /* performing a reduction */ \ - macro (ompt_state_work_free_agent, 0x003) /* free agent thread */ \ - macro (ompt_state_work_induction, 0x004) /* induction */ \ \ /* barrier wait states (16..31) */ \ macro (ompt_state_wait_barrier, 0x010) /* waiting at a barrier */ \ @@ -223,44 +218,44 @@ extern "C" { #endif typedef enum ompt_callbacks_t { - ompt_callback_thread_begin = 1, - ompt_callback_thread_end = 2, - ompt_callback_parallel_begin = 3, - ompt_callback_parallel_end = 4, - ompt_callback_task_create = 5, - ompt_callback_task_schedule = 6, - ompt_callback_implicit_task = 7, - ompt_callback_target DEPRECATED_60 = 8, - ompt_callback_target_data_op DEPRECATED_60 = 9, - ompt_callback_target_submit DEPRECATED_60 = 10, - ompt_callback_control_tool = 11, - ompt_callback_device_initialize = 12, - ompt_callback_device_finalize = 13, - ompt_callback_device_load = 14, - ompt_callback_device_unload = 15, - ompt_callback_sync_region_wait = 16, - ompt_callback_mutex_released = 17, - ompt_callback_dependences = 18, - ompt_callback_task_dependence = 19, - ompt_callback_work = 20, - ompt_callback_master DEPRECATED_51 = 21, - ompt_callback_masked = 21, - ompt_callback_target_map DEPRECATED_60 = 22, - ompt_callback_sync_region = 23, - ompt_callback_lock_init = 24, - ompt_callback_lock_destroy = 25, - ompt_callback_mutex_acquire = 26, - ompt_callback_mutex_acquired = 27, - ompt_callback_nest_lock = 28, - ompt_callback_flush = 29, - ompt_callback_cancel = 30, - ompt_callback_reduction = 31, - ompt_callback_dispatch = 32, - ompt_callback_target_emi = 33, - ompt_callback_target_data_op_emi = 34, - ompt_callback_target_submit_emi = 35, - ompt_callback_target_map_emi = 36, - ompt_callback_error = 37 + ompt_callback_thread_begin = 1, + ompt_callback_thread_end = 2, + ompt_callback_parallel_begin = 3, + ompt_callback_parallel_end = 4, + ompt_callback_task_create = 5, + ompt_callback_task_schedule = 6, + ompt_callback_implicit_task = 7, + ompt_callback_target = 8, + ompt_callback_target_data_op = 9, + ompt_callback_target_submit = 10, + ompt_callback_control_tool = 11, + ompt_callback_device_initialize = 12, + ompt_callback_device_finalize = 13, + ompt_callback_device_load = 14, + ompt_callback_device_unload = 15, + ompt_callback_sync_region_wait = 16, + ompt_callback_mutex_released = 17, + ompt_callback_dependences = 18, + ompt_callback_task_dependence = 19, + ompt_callback_work = 20, + ompt_callback_master DEPRECATED_51 = 21, + ompt_callback_masked = 21, + ompt_callback_target_map = 22, + ompt_callback_sync_region = 23, + ompt_callback_lock_init = 24, + ompt_callback_lock_destroy = 25, + ompt_callback_mutex_acquire = 26, + ompt_callback_mutex_acquired = 27, + ompt_callback_nest_lock = 28, + ompt_callback_flush = 29, + ompt_callback_cancel = 30, + ompt_callback_reduction = 31, + ompt_callback_dispatch = 32, + ompt_callback_target_emi = 33, + ompt_callback_target_data_op_emi = 34, + ompt_callback_target_submit_emi = 35, + ompt_callback_target_map_emi = 36, + ompt_callback_error = 37 } ompt_callbacks_t; typedef enum ompt_record_t { @@ -324,22 +319,16 @@ typedef enum ompt_sync_region_t { } ompt_sync_region_t; typedef enum ompt_target_data_op_t { - ompt_target_data_alloc = 1, - ompt_target_data_transfer_to_device DEPRECATED_60 = 2, - ompt_target_data_transfer_from_device DEPRECATED_60 = 3, - ompt_target_data_delete = 4, - ompt_target_data_associate = 5, - ompt_target_data_disassociate = 6, - ompt_target_data_transfer = 7, - ompt_target_data_memset = 8, - ompt_target_data_transfer_rect = 9, - ompt_target_data_alloc_async = 17, - ompt_target_data_transfer_to_device_async DEPRECATED_60 = 18, - ompt_target_data_transfer_from_device_async DEPRECATED_60 = 19, - ompt_target_data_delete_async = 20, - ompt_target_data_transfer_async = 23, - ompt_target_data_memset_async = 24, - ompt_target_data_transfer_rect_async = 25 + ompt_target_data_alloc = 1, + ompt_target_data_transfer_to_device = 2, + ompt_target_data_transfer_from_device = 3, + ompt_target_data_delete = 4, + ompt_target_data_associate = 5, + ompt_target_data_disassociate = 6, + ompt_target_data_alloc_async = 17, + ompt_target_data_transfer_to_device_async = 18, + ompt_target_data_transfer_from_device_async = 19, + ompt_target_data_delete_async = 20 } ompt_target_data_op_t; typedef enum ompt_work_t { @@ -351,7 +340,6 @@ typedef enum ompt_work_t { ompt_work_distribute = 6, ompt_work_taskloop = 7, ompt_work_scope = 8, - ompt_work_workdistribute = 9, ompt_work_loop_static = 10, ompt_work_loop_dynamic = 11, ompt_work_loop_guided = 12, @@ -385,8 +373,6 @@ typedef enum ompt_task_flag_t { ompt_task_explicit = 0x00000004, ompt_task_target = 0x00000008, ompt_task_taskwait = 0x00000010, - ompt_task_importing = 0x02000000, - ompt_task_exporting = 0x04000000, ompt_task_undeferred = 0x08000000, ompt_task_untied = 0x10000000, ompt_task_final = 0x20000000, @@ -429,11 +415,7 @@ typedef enum ompt_target_map_flag_t { ompt_target_map_flag_alloc = 0x04, ompt_target_map_flag_release = 0x08, ompt_target_map_flag_delete = 0x10, - ompt_target_map_flag_implicit = 0x20, - ompt_target_map_flag_always = 0x40, - ompt_target_map_flag_present = 0x80, - ompt_target_map_flag_close = 0x100, - ompt_target_map_flag_shared = 0x200 + ompt_target_map_flag_implicit = 0x20 } ompt_target_map_flag_t; typedef enum ompt_dependence_type_t { @@ -479,8 +461,6 @@ typedef enum ompt_state_t { ompt_state_work_serial = 0x000, ompt_state_work_parallel = 0x001, ompt_state_work_reduction = 0x002, - ompt_state_work_free_agent = 0x003, - ompt_state_work_induction = 0x004, ompt_state_wait_barrier DEPRECATED_51 = 0x010, ompt_state_wait_barrier_implicit_parallel = 0x011, @@ -528,9 +508,7 @@ typedef enum ompd_scope_t { ompd_scope_thread = 3, ompd_scope_parallel = 4, ompd_scope_implicit_task = 5, - ompd_scope_task = 6, - ompd_scope_teams = 7, - ompd_scope_target = 8 + ompd_scope_task = 6 } ompd_scope_t; typedef uint64_t ompd_icv_id_t; @@ -548,17 +526,9 @@ typedef enum ompd_rc_t { ompd_rc_device_write_error = 9, ompd_rc_nomem = 10, ompd_rc_incomplete = 11, - ompd_rc_callback_error = 12, - ompd_rc_incompatible_handle = 13 + ompd_rc_callback_error = 12 } ompd_rc_t; -typedef enum ompd_team_generator_t { - ompd_generator_program = 0, - ompd_generator_parallel = 1, - ompd_generator_teams = 2, - ompd_generator_target = 3 -} ompd_team_generator_t; - typedef void (*ompt_interface_fn_t) (void); typedef ompt_interface_fn_t (*ompt_function_lookup_t) ( @@ -631,15 +601,6 @@ typedef struct ompt_dispatch_chunk_t { uint64_t iterations; } ompt_dispatch_chunk_t; -typedef struct ompt_subvolume_t { - const void *base; - uint64_t size; - uint64_t num_dims; - const uint64_t *volume; - const uint64_t *offsets; - const uint64_t *dimensions; -} ompt_subvolume_t; - typedef int (*ompt_enumerate_states_t) ( int current_state, int *next_state, @@ -743,12 +704,6 @@ typedef ompt_set_result_t (*ompt_set_trace_native_t) ( int flags ); -typedef void (*ompt_get_buffer_limits_t) ( - ompt_device_t *device, - int *max_concurrent_allocs, - size_t *recommended_bytes -); - typedef int (*ompt_start_trace_t) ( ompt_device_t *device, ompt_callback_buffer_request_t request, @@ -1082,9 +1037,9 @@ typedef void (*ompt_callback_target_data_op_t) ( int dest_device_num, size_t bytes, const void *codeptr_ra -); // deprecated since 6.0 +); -typedef struct ompt_record_target_data_op_emi_t { +typedef struct ompt_record_target_data_op_t { ompt_id_t host_op_id; ompt_target_data_op_t optype; void *src_addr; @@ -1094,9 +1049,7 @@ typedef struct ompt_record_target_data_op_emi_t { size_t bytes; ompt_device_time_t end_time; const void *codeptr_ra; -} ompt_record_target_data_op_emi_t; -typedef ompt_record_target_data_op_emi_t ompt_record_target_data_op_t - DEPRECATED_60; +} ompt_record_target_data_op_t; typedef void (*ompt_callback_target_emi_t) ( ompt_target_t kind, @@ -1115,17 +1068,16 @@ typedef void (*ompt_callback_target_t) ( ompt_data_t *task_data, ompt_id_t target_id, const void *codeptr_ra -); // deprecated since 6.0 +); -typedef struct ompt_record_target_emi_t { +typedef struct ompt_record_target_t { ompt_target_t kind; ompt_scope_endpoint_t endpoint; int device_num; ompt_id_t task_id; ompt_id_t target_id; const void *codeptr_ra; -} ompt_record_target_emi_t; -typedef ompt_record_target_emi_t ompt_record_target_t DEPRECATED_60; +} ompt_record_target_t; typedef void (*ompt_callback_target_map_emi_t) ( ompt_data_t *target_data, @@ -1145,9 +1097,9 @@ typedef void (*ompt_callback_target_map_t) ( size_t *bytes, unsigned int *mapping_flags, const void *codeptr_ra -); // deprecated since 6.0 +); -typedef struct ompt_record_target_map_emi_t { +typedef struct ompt_record_target_map_t { ompt_id_t target_id; unsigned int nitems; void **host_addr; @@ -1155,8 +1107,7 @@ typedef struct ompt_record_target_map_emi_t { size_t *bytes; unsigned int *mapping_flags; const void *codeptr_ra; -} ompt_record_target_map_emi_t; -typedef ompt_record_target_map_emi_t ompt_record_target_map_t DEPRECATED_60; +} ompt_record_target_map_t; typedef void (*ompt_callback_target_submit_emi_t) ( ompt_scope_endpoint_t endpoint, @@ -1171,14 +1122,12 @@ typedef void (*ompt_callback_target_submit_t) ( unsigned int requested_num_teams ); -typedef struct ompt_record_target_submit_emi_t { +typedef struct ompt_record_target_kernel_t { ompt_id_t host_op_id; unsigned int requested_num_teams; unsigned int granted_num_teams; ompt_device_time_t end_time; -} ompt_record_target_submit_emi_t; -typedef ompt_record_target_submit_emi_t ompt_record_target_kernel_t - DEPRECATED_60; +} ompt_record_target_kernel_t; typedef int (*ompt_callback_control_tool_t) ( uint64_t command, @@ -1425,42 +1374,35 @@ ompd_rc_t ompd_get_icv_string_from_scope(void *handle, ompd_scope_t scope, ompd_rc_t ompd_get_tool_data(void *handle, ompd_scope_t scope, ompd_word_t *value, ompd_address_t *ptr); -typedef union ompt_any_record_ompt_t { - ompt_record_thread_begin_t thread_begin; - ompt_record_parallel_begin_t parallel_begin; - ompt_record_parallel_end_t parallel_end; - ompt_record_work_t work; - ompt_record_dispatch_t dispatch; - ompt_record_task_create_t task_create; - ompt_record_dependences_t dependences; - ompt_record_task_dependence_t task_dependence; - ompt_record_task_schedule_t task_schedule; - ompt_record_implicit_task_t implicit_task; - ompt_record_masked_t masked; - ompt_record_sync_region_t sync_region; - ompt_record_mutex_acquire_t mutex_acquire; - ompt_record_mutex_t mutex; - ompt_record_nest_lock_t nest_lock; - ompt_record_flush_t flush; - ompt_record_cancel_t cancel; - ompt_record_target_t target DEPRECATED_60; - ompt_record_target_data_op_t target_data_op DEPRECATED_60; - ompt_record_target_map_t target_map DEPRECATED_60; - ompt_record_target_kernel_t target_kernel DEPRECATED_60; - ompt_record_target_emi_t target_emi; - ompt_record_target_data_op_emi_t target_data_op_emi; - ompt_record_target_map_emi_t target_map_emi; - ompt_record_target_submit_emi_t target_submit_emi; - ompt_record_control_tool_t control_tool; - ompt_record_error_t error; -} ompt_any_record_ompt_t; - typedef struct ompt_record_ompt_t { ompt_callbacks_t type; ompt_device_time_t time; ompt_id_t thread_id; ompt_id_t target_id; - ompt_any_record_ompt_t record; + union { + ompt_record_thread_begin_t thread_begin; + ompt_record_parallel_begin_t parallel_begin; + ompt_record_parallel_end_t parallel_end; + ompt_record_work_t work; + ompt_record_dispatch_t dispatch; + ompt_record_task_create_t task_create; + ompt_record_dependences_t dependences; + ompt_record_task_dependence_t task_dependence; + ompt_record_task_schedule_t task_schedule; + ompt_record_implicit_task_t implicit_task; + ompt_record_masked_t masked; + ompt_record_sync_region_t sync_region; + ompt_record_mutex_acquire_t mutex_acquire; + ompt_record_mutex_t mutex; + ompt_record_nest_lock_t nest_lock; + ompt_record_flush_t flush; + ompt_record_cancel_t cancel; + ompt_record_target_t target; + ompt_record_target_data_op_t target_data_op; + ompt_record_target_map_t target_map; + ompt_record_target_kernel_t target_kernel; + ompt_record_control_tool_t control_tool; + } record; } ompt_record_ompt_t; typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) ( diff --git a/system/lib/openmp/src/include/omp.h.var b/system/lib/openmp/src/include/omp.h.var index b05074198ca3f..e98df731ad888 100644 --- a/system/lib/openmp/src/include/omp.h.var +++ b/system/lib/openmp/src/include/omp.h.var @@ -380,11 +380,6 @@ omp_uintptr_t value; } omp_alloctrait_t; - typedef enum { - omp_access_cgroup = 0, - omp_access_pteam = 1 - } omp_access_t; - # if defined(_WIN32) // On Windows cl and icl do not support 64-bit enum, let's use integer then. typedef omp_uintptr_t omp_allocator_handle_t; @@ -408,7 +403,6 @@ extern __KMP_IMP omp_memspace_handle_t const omp_const_mem_space; extern __KMP_IMP omp_memspace_handle_t const omp_high_bw_mem_space; extern __KMP_IMP omp_memspace_handle_t const omp_low_lat_mem_space; - extern __KMP_IMP omp_memspace_handle_t const omp_cgroup_mem_space; extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_host_mem_space; extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_shared_mem_space; extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_device_mem_space; @@ -445,7 +439,6 @@ omp_const_mem_space = 2, omp_high_bw_mem_space = 3, omp_low_lat_mem_space = 4, - omp_cgroup_mem_space = 5, llvm_omp_target_host_mem_space = 100, llvm_omp_target_shared_mem_space = 101, llvm_omp_target_device_mem_space = 102, @@ -470,11 +463,6 @@ omp_allocator_handle_t allocator = omp_null_allocator, omp_allocator_handle_t free_allocator = omp_null_allocator); extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, omp_allocator_handle_t a = omp_null_allocator); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_ptr(size_t offset = 0, omp_access_t access_group = omp_access_cgroup); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_nofb_ptr(size_t offset = 0, omp_access_t access_group = omp_access_cgroup); - extern size_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_size(omp_access_t access_group = omp_access_cgroup); - extern omp_memspace_handle_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_memspace(omp_access_t access_group = omp_access_cgroup); - extern size_t __KAI_KMPC_CONVENTION omp_get_gprivate_limit(int device_num, omp_access_t access_group = omp_access_cgroup); # else extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a); extern void *__KAI_KMPC_CONVENTION omp_aligned_alloc(size_t align, size_t size, @@ -485,11 +473,6 @@ extern void *__KAI_KMPC_CONVENTION omp_realloc(void *ptr, size_t size, omp_allocator_handle_t allocator, omp_allocator_handle_t free_allocator); extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_ptr(size_t offset, omp_access_t access_group); - extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_nofb_ptr(size_t offset, omp_access_t access_group); - extern size_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_size(omp_access_t access_group); - extern omp_memspace_handle_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_memspace(omp_access_t access_group); - extern size_t __KAI_KMPC_CONVENTION omp_get_gprivate_limit(int device_num, omp_access_t access_group); # endif /* OpenMP TR11 routines to get memory spaces and allocators */ @@ -553,7 +536,6 @@ /* OpenMP 5.2 */ extern int __KAI_KMPC_CONVENTION omp_in_explicit_task(void); - #define omp_initial_device -1 #define omp_invalid_device -2 /* OpenMP 6.0 */ diff --git a/system/lib/openmp/src/include/ompx.h.var b/system/lib/openmp/src/include/ompx.h.var index a79ec34b81fa2..6884745f4240c 100644 --- a/system/lib/openmp/src/include/ompx.h.var +++ b/system/lib/openmp/src/include/ompx.h.var @@ -9,7 +9,7 @@ #ifndef __OMPX_H #define __OMPX_H -#if (defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__)) +#if (defined(__NVPTX__) || defined(__AMDGPU__)) #include #define __OMPX_TARGET_IS_GPU #endif diff --git a/system/lib/openmp/src/kmp.h b/system/lib/openmp/src/kmp.h index 818e07c2bb23f..36c40abaf1ef4 100644 --- a/system/lib/openmp/src/kmp.h +++ b/system/lib/openmp/src/kmp.h @@ -45,8 +45,21 @@ #define TASK_DETACHABLE 1 #define TASK_UNDETACHABLE 0 +#define KMP_CANCEL_THREADS #define KMP_THREAD_ATTR +// Android does not have pthread_cancel. Undefine KMP_CANCEL_THREADS if being +// built on Android +#if defined(__ANDROID__) +#undef KMP_CANCEL_THREADS +#endif + +// Some WASI targets (e.g., wasm32-wasi-threads) do not support thread +// cancellation. +#if KMP_OS_WASI +#undef KMP_CANCEL_THREADS +#endif + #if !KMP_OS_WASI #include #endif @@ -1059,7 +1072,6 @@ extern omp_memspace_handle_t const omp_large_cap_mem_space; extern omp_memspace_handle_t const omp_const_mem_space; extern omp_memspace_handle_t const omp_high_bw_mem_space; extern omp_memspace_handle_t const omp_low_lat_mem_space; -extern omp_memspace_handle_t const omp_cgroup_mem_space; extern omp_memspace_handle_t const llvm_omp_target_host_mem_space; extern omp_memspace_handle_t const llvm_omp_target_shared_mem_space; extern omp_memspace_handle_t const llvm_omp_target_device_mem_space; @@ -2618,7 +2630,7 @@ typedef struct { } ed; } kmp_event_t; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // Initial number of allocated nodes while recording #define INIT_MAPSIZE 50 @@ -2678,7 +2690,7 @@ extern kmp_int32 __kmp_num_tdg; typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */ #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) /* Same fields as in the #else branch, but in reverse order */ -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH unsigned reserved31 : 4; unsigned onced : 1; #else @@ -2739,7 +2751,7 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */ unsigned native : 1; /* 1==gcc-compiled task, 0==intel */ unsigned target : 1; unsigned hidden_helper : 1; /* 1 == hidden helper task */ -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH unsigned onced : 1; /* 1==ran once already, 0==never ran, record & replay purposes */ unsigned reserved31 : 4; /* reserved for library use */ #else @@ -2794,7 +2806,7 @@ struct kmp_taskdata { /* aligned during dynamic allocation */ #if OMPT_SUPPORT ompt_task_info_t ompt_task_info; #endif -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH bool is_taskgraph = 0; // whether the task is within a TDG kmp_tdg_info_t *tdg; // used to associate task with a TDG kmp_int32 td_tdg_task_id; // local task id in its TDG @@ -3889,8 +3901,7 @@ extern void __kmp_check_stack_overlap(kmp_info_t *thr); extern void __kmp_expand_host_name(char *buffer, size_t size); extern void __kmp_expand_file_name(char *result, size_t rlen, char *pattern); -#if KMP_ARCH_X86 || KMP_ARCH_X86_64 || \ - (KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC)) +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 || (KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM)) extern void __kmp_initialize_system_tick(void); /* Initialize timer tick value */ #endif @@ -4373,7 +4384,7 @@ KMP_EXPORT void __kmpc_init_nest_lock_with_hint(ident_t *loc, kmp_int32 gtid, void **user_lock, uintptr_t hint); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // Taskgraph's Record & Replay mechanism // __kmp_tdg_is_recording: check whether a given TDG is recording // status: the tdg's current status diff --git a/system/lib/openmp/src/kmp_adt.cpp b/system/lib/openmp/src/kmp_adt.cpp deleted file mode 100644 index b960b4e0aaf31..0000000000000 --- a/system/lib/openmp/src/kmp_adt.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * kmp_adt.cpp -- Advanced Data Types used internally - * - * FIXME: This is in intermediate solution until we agree and implement some - * common resource according to - * https://discourse.llvm.org/t/meta-rfc-adts-without-c-runtime-dependency/90317. - * As soon as we will have this common resource that can be used for runtimes - * such as openmp that want to avoid the link dependency to the C++ STL, this - * shall be refactored. - */ - -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "kmp_adt.h" -#include "kmp.h" -#include "kmp_str.h" - -#include -#include - -bool kmp_str_ref::consume_integer(int &value, bool allow_zero, - bool allow_negative) { - kmp_str_ref orig = *this; // save state - bool is_negative = consume_front("-"); - if (is_negative && !allow_negative) { - *this = orig; - return false; - } - size_t num_digits = count_while( - [](char c) { return isdigit(static_cast(c)) != 0; }); - if (!num_digits) { - *this = orig; - return false; - } - value = __kmp_basic_str_to_int(data, num_digits); - if (value == INT_MAX) { - *this = orig; - return false; - } - drop_front(num_digits); - if (is_negative) - value = -value; - if (!allow_zero && value == 0) { - *this = orig; - return false; - } - return true; -} - -char *kmp_str_ref::copy() const { - char *copy_str = static_cast(KMP_INTERNAL_MALLOC(len + 1)); - if (!copy_str) - KMP_FATAL(MemoryAllocFailed); - memcpy(copy_str, data, len); - copy_str[len] = '\0'; - return copy_str; -} diff --git a/system/lib/openmp/src/kmp_adt.h b/system/lib/openmp/src/kmp_adt.h deleted file mode 100644 index 541fd827f8fea..0000000000000 --- a/system/lib/openmp/src/kmp_adt.h +++ /dev/null @@ -1,336 +0,0 @@ -/* - * kmp_adt.h -- Advanced Data Types used internally - * - * FIXME: This is in intermediate solution until we agree and implement some - * common resource according to - * https://discourse.llvm.org/t/meta-rfc-adts-without-c-runtime-dependency/90317. - * As soon as we will have this common resource that can be used for runtimes - * such as openmp that want to avoid the link dependency to the C++ STL, this - * shall be refactored. - */ - -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef KMP_ADT_H -#define KMP_ADT_H - -#include -#include -#include -#include -#include -#include -#include - -#include "kmp.h" - -/// kmp_str_ref is a non-owning string class (similar to llvm::StringRef). -class kmp_str_ref final { - const char *data; - size_t len; - -public: - static constexpr size_t npos = SIZE_MAX; - - kmp_str_ref(const char *str) : data(str), len(str ? strlen(str) : 0) {} - kmp_str_ref(const char *str, size_t len) : data(str), len(len) { - assert((data || !len) && "len must be 0 for nullptr data"); - } - - kmp_str_ref(const kmp_str_ref &other) = default; - kmp_str_ref &operator=(const kmp_str_ref &other) = default; - - /// Check if the string starts with the given prefix and remove it from the - /// string afterwards. - bool consume_front(kmp_str_ref prefix) { - if (len < prefix.len) - return false; - if (empty() || prefix.empty()) // avoid calling memcmp on potential nullptr - return true; - if (memcmp(data, prefix.data, prefix.len) != 0) - return false; - drop_front(prefix.len); - return true; - } - - /// Start consuming an integer from the start of the string and remove it from - /// the string afterwards. - /// The maximum integer value that can currently be parsed is INT_MAX - 1. - bool consume_integer(int &value, bool allow_zero = true, - bool allow_negative = false); - - /// Get an own duplicate of the string. - /// Must be freed with KMP_INTERNAL_FREE(). - char *copy() const; - - /// Count the number of characters in the string while the predicate returns - /// true. - template size_t count_while(const Fn &predicate) const { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(char)"); - size_t n = find_if_not(predicate); - return n == npos ? len : n; - } - - /// Drop the first n characters from the string. - /// (Limit n to the length of the string.) - void drop_front(size_t n) { - if (n > len) - n = len; - data += n; - len -= n; - } - - /// Drop characters from the string while the predicate returns true. - template void drop_while(const Fn &predicate) { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(char)"); - drop_front(count_while(predicate)); - } - - /// Check if the string is empty. - bool empty() const { return len == 0; } - - /// Return the index of the first character in the string for which the - /// predicate returns true. - /// Returns npos if no match is found. - template size_t find_if(const Fn &predicate) const { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(char)"); - size_t i = 0; - while (i < len && !predicate(data[i])) - ++i; - return i < len ? i : npos; - } - - /// Return the index of the first character in the string for which the - /// predicate returns false. - /// Returns npos if no match is found. - template size_t find_if_not(const Fn &predicate) const { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(char)"); - return find_if([predicate](char c) { return !predicate(c); }); - } - - /// Get the length of the string. - size_t length() const { return len; } - size_t size() const { return length(); } - - /// Drop space from the start of the string. - void skip_space() { - drop_while([](char c) { - return static_cast(isspace(static_cast(c))); - }); - } - - /// Construct a new string with the longest prefix of the original string that - /// satisfies the predicate. Doesn't modify the original string. - template kmp_str_ref take_while(const Fn &predicate) const { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(char)"); - return kmp_str_ref(data, count_while(predicate)); - } - - /// Iterator support (raw pointers work as iterators for contiguous storage) - const char *begin() const { return data; } - const char *end() const { return data + len; } -}; - -/// kmp_vector is a vector class for managing small vectors. -/// INLINE_THRESHOLD: Number of elements in the inline array. If exceeded, the -/// vector will grow dynamically. -template class kmp_vector final { - static_assert(std::is_copy_constructible_v, - "T must be copy constructible"); - static_assert(std::is_destructible_v, "T must be destructible"); - - struct default_eq { - bool operator()(const T &a, const T &b) const { return a == b; } - }; - - T inline_data[INLINE_THRESHOLD]; - T *data = inline_data; - size_t count = 0; - size_t capacity = INLINE_THRESHOLD; - - void copy_data(T *dst, const T *src, size_t num_elements) { - if constexpr (std::is_trivially_copyable_v) { - memcpy(dst, src, num_elements * sizeof(T)); - } else { - for (size_t i = 0; i < num_elements; i++) - new (&dst[i]) T(src[i]); // copy-construct to memory - } - } - - /// Grow by ~1.5x / at least by +1 element. - /// If MinSize > 0, grow only if necessary to guarantee space - /// for at least MinSize elements. - void grow(size_t MinSize = 0) { - if (MinSize) { - if (MinSize <= capacity) - return; - capacity = MinSize; - } else { - capacity = capacity + (capacity / 2) + 1; - } - T *old_data = data != inline_data ? data : nullptr; - data = - static_cast(KMP_INTERNAL_REALLOC(old_data, capacity * sizeof(T))); - if (!data) - KMP_FATAL(MemoryAllocFailed); - // Copy the data to the new array if we didn't use a dynamic array before. - if (!old_data) - copy_data(data, inline_data, count); - } - - void init(size_t new_capacity, const T *init_data, size_t new_count) { - assert(new_capacity >= new_count && - "more elements requested than capacity"); - if (new_capacity > capacity) - grow(new_capacity); - if (init_data) - copy_data(data, init_data, new_count); - count = new_count; - } - - /// Move data from other vector to this vector (which must be emptied before) - void move_from(kmp_vector &&other) { - assert(empty() && "must be empty before overwriting"); - if (other.data == other.inline_data) { - // Cannot move inline data, must copy. - init(other.capacity, other.data, other.count); - } else { - // Steal dynamic data. - data = other.data; - count = other.count; - capacity = other.capacity; - } - other.reset(/*free_data=*/false); - } - - void reset(bool free_data) { - if (free_data && data != inline_data) { - clear(); - KMP_INTERNAL_FREE(data); - } - data = inline_data; - count = 0; - capacity = INLINE_THRESHOLD; - } - -public: - ~kmp_vector() { reset(/*free_data=*/true); } - - explicit kmp_vector(size_t capacity = 0) { init(capacity, nullptr, 0); } - - kmp_vector(size_t capacity, const T *init_data, size_t count) { - init(capacity, init_data, count); - } - - kmp_vector(const kmp_vector &other) { - init(other.capacity, other.data, other.count); - } - - kmp_vector(kmp_vector &&other) noexcept { move_from(std::move(other)); } - - kmp_vector &operator=(const kmp_vector &other) { - if (this != &other) { - reset(/*free_data=*/true); - init(other.capacity, other.data, other.count); - } - return *this; - } - - kmp_vector &operator=(kmp_vector &&other) noexcept { - if (this != &other) { - reset(/*free_data=*/true); - move_from(std::move(other)); - } - return *this; - } - - /// Destroy all elements in the vector. Doesn't free the memory. - void clear() { - if constexpr (!std::is_trivially_destructible_v) { - for (size_t i = 0; i < count; i++) - data[i].~T(); - } - count = 0; - } - - /// Check if the vector contains the given value. - /// If a comparator is provided, it will be used to compare the values. - /// Otherwise, the equality operator will be used. - template - bool contains(const T &value, const Fn &comp = Fn{}) const { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(const T &, const T &)"); - for (size_t i = 0; i < count; i++) { - if (comp(data[i], value)) - return true; - } - return false; - } - - bool empty() const { return !count; } - - /// Check if the two vectors are equal with set semantics. - /// Current implementation is naive O(n^2) and not optimized for performance. - /// Handles duplicates correctly. - template - bool is_set_equal(const kmp_vector &other, const Fn &comp = Fn{}) const { - static_assert(std::is_invocable_r_v, - "predicate must be callable as bool(const T &, const T &)"); - for (const T &val : *this) { - if (!other.contains(val, comp)) - return false; - } - for (const T &val : other) { - if (!contains(val, comp)) - return false; - } - return true; - } - - /// Add a new element to the end of the vector. - void push_back(const T &value) { - if (count == capacity) - grow(); - if constexpr (std::is_trivially_copyable_v) - data[count++] = value; - else - new (&data[count++]) T(value); - } - - /// Reserve space for the given number of elements. - /// (Note: does not shrink the vector.) - void reserve(size_t new_capacity) { - if (new_capacity > capacity) - grow(new_capacity); - } - - size_t size() const { return count; } - - T &operator[](size_t index) { - assert(index < count && "Index out of bounds"); - return data[index]; - } - const T &operator[](size_t index) const { - assert(index < count && "Index out of bounds"); - return data[index]; - } - - /// Iterator support (raw pointers work as iterators for contiguous storage) - T *begin() { return data; } - T *end() { return data + count; } - const T *begin() const { return data; } - const T *end() const { return data + count; } -}; - -#endif // KMP_ADT_H diff --git a/system/lib/openmp/src/kmp_alloc.cpp b/system/lib/openmp/src/kmp_alloc.cpp index fa48193681f17..d43daefb6ef1e 100644 --- a/system/lib/openmp/src/kmp_alloc.cpp +++ b/system/lib/openmp/src/kmp_alloc.cpp @@ -1235,29 +1235,27 @@ void ___kmp_thread_free(kmp_info_t *th, void *ptr KMP_SRC_LOC_DECL) { } /* OMP 5.0 Memory Management support */ +static const char *kmp_mk_lib_name; +static void *h_memkind; /* memkind experimental API: */ // memkind_alloc static void *(*kmp_mk_alloc)(void *k, size_t sz); // memkind_free static void (*kmp_mk_free)(void *kind, void *ptr); +// memkind_check_available +static int (*kmp_mk_check)(void *kind); // kinds we are going to use static void **mk_default; static void **mk_interleave; +static void **mk_hbw; static void **mk_hbw_interleave; static void **mk_hbw_preferred; -static void **mk_dax_kmem; -static void **mk_dax_kmem_all; -#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !KMP_OS_DARWIN -static const char *kmp_mk_lib_name; -static void *h_memkind; -// memkind_check_available -static int (*kmp_mk_check)(void *kind); -static void **mk_hbw; static void **mk_hugetlb; static void **mk_hbw_hugetlb; static void **mk_hbw_preferred_hugetlb; +static void **mk_dax_kmem; +static void **mk_dax_kmem_all; static void **mk_dax_kmem_preferred; -#endif static void *(*kmp_target_alloc_host)(size_t size, int device); static void *(*kmp_target_alloc_shared)(size_t size, int device); static void *(*kmp_target_alloc_device)(size_t size, int device); @@ -1502,27 +1500,28 @@ void __kmp_init_memkind() { } dlclose(h_memkind); // failure } +#else // !(KMP_OS_UNIX && KMP_DYNAMIC_LIB) + kmp_mk_lib_name = ""; +#endif // !(KMP_OS_UNIX && KMP_DYNAMIC_LIB) h_memkind = NULL; kmp_mk_check = NULL; - mk_hbw = NULL; - mk_hugetlb = NULL; - mk_hbw_hugetlb = NULL; - mk_hbw_preferred_hugetlb = NULL; - mk_dax_kmem_preferred = NULL; - kmp_mk_lib_name = ""; -#endif // !(KMP_OS_UNIX && KMP_DYNAMIC_LIB && !KMP_OS_DARWIN) kmp_mk_alloc = NULL; kmp_mk_free = NULL; mk_default = NULL; mk_interleave = NULL; + mk_hbw = NULL; mk_hbw_interleave = NULL; mk_hbw_preferred = NULL; + mk_hugetlb = NULL; + mk_hbw_hugetlb = NULL; + mk_hbw_preferred_hugetlb = NULL; mk_dax_kmem = NULL; mk_dax_kmem_all = NULL; + mk_dax_kmem_preferred = NULL; } void __kmp_fini_memkind() { -#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !KMP_OS_DARWIN +#if KMP_OS_UNIX && KMP_DYNAMIC_LIB if (__kmp_memkind_available) KE_TRACE(25, ("__kmp_fini_memkind: finalize memkind library\n")); if (h_memkind) { @@ -1530,21 +1529,19 @@ void __kmp_fini_memkind() { h_memkind = NULL; } kmp_mk_check = NULL; - mk_hbw = NULL; - mk_hugetlb = NULL; - mk_hbw_hugetlb = NULL; - mk_hbw_preferred_hugetlb = NULL; - mk_dax_kmem_preferred = NULL; -#endif -#if KMP_OS_UNIX && KMP_DYNAMIC_LIB kmp_mk_alloc = NULL; kmp_mk_free = NULL; mk_default = NULL; mk_interleave = NULL; + mk_hbw = NULL; mk_hbw_interleave = NULL; mk_hbw_preferred = NULL; + mk_hugetlb = NULL; + mk_hbw_hugetlb = NULL; + mk_hbw_preferred_hugetlb = NULL; mk_dax_kmem = NULL; mk_dax_kmem_all = NULL; + mk_dax_kmem_preferred = NULL; #endif } diff --git a/system/lib/openmp/src/kmp_atomic.cpp b/system/lib/openmp/src/kmp_atomic.cpp index d259737eb5ce1..261e9f1beee67 100644 --- a/system/lib/openmp/src/kmp_atomic.cpp +++ b/system/lib/openmp/src/kmp_atomic.cpp @@ -832,7 +832,7 @@ static inline kmp_cmplx128_a16_t operator/(kmp_cmplx128_a16_t &lhs, // end of the first part of the workaround for C78287 #endif // USE_CMPXCHG_FIX -#if KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC) +#if KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM) // Undo explicit type casts to get MSVC ARM64 to build. Uses // OP_CMPXCHG_WORKAROUND definition for OP_CMPXCHG #undef OP_CMPXCHG diff --git a/system/lib/openmp/src/kmp_config.h.cmake b/system/lib/openmp/src/kmp_config.h.cmake index c5e8cfa5154e9..40f1087fd7f27 100644 --- a/system/lib/openmp/src/kmp_config.h.cmake +++ b/system/lib/openmp/src/kmp_config.h.cmake @@ -46,8 +46,8 @@ #define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT #cmakedefine01 LIBOMP_OMPD_SUPPORT #define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT -#cmakedefine01 LIBOMP_TASKGRAPH_EXPERIMENTAL -#define OMP_TASKGRAPH_EXPERIMENTAL LIBOMP_TASKGRAPH_EXPERIMENTAL +#cmakedefine01 LIBOMP_OMPX_TASKGRAPH +#define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH #cmakedefine01 LIBOMP_PROFILING_SUPPORT #define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT #cmakedefine01 LIBOMP_OMPT_OPTIONAL @@ -96,8 +96,6 @@ #define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN #cmakedefine01 LIBOMP_HAVE__ALIGNED_MALLOC #define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC -#cmakedefine01 LIBOMP_USE_CANCEL_THREADS -#define KMP_CANCEL_THREADS LIBOMP_USE_CANCEL_THREADS #cmakedefine01 OPENMP_ENABLE_LIBOMPTARGET #define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET diff --git a/system/lib/openmp/src/kmp_csupport.cpp b/system/lib/openmp/src/kmp_csupport.cpp index 8aa9a9caa924b..a92fc46374c27 100644 --- a/system/lib/openmp/src/kmp_csupport.cpp +++ b/system/lib/openmp/src/kmp_csupport.cpp @@ -4515,20 +4515,6 @@ void omp_free(void *ptr, omp_allocator_handle_t allocator) { } /* end of OpenMP 5.1 Memory Management routines */ -void *omp_get_dyn_gprivate_ptr(size_t offset, omp_access_t access_group) { - return NULL; -} - -void *omp_get_dyn_gprivate_nofb_ptr(size_t offset, omp_access_t access_group) { - return NULL; -} - -size_t omp_get_dyn_gprivate_size(omp_access_t access_group) { return 0; } - -omp_memspace_handle_t omp_get_dyn_gprivate_memspace(omp_access_t access_group) { - return omp_null_mem_space; -} - int __kmpc_get_target_offload(void) { if (!__kmp_init_serial) { __kmp_serial_initialize(); diff --git a/system/lib/openmp/src/kmp_ftn_entry.h b/system/lib/openmp/src/kmp_ftn_entry.h index 1c8e568b78407..dc57a6a74668e 100644 --- a/system/lib/openmp/src/kmp_ftn_entry.h +++ b/system/lib/openmp/src/kmp_ftn_entry.h @@ -1636,23 +1636,9 @@ void FTN_STDCALL FTN_SET_NUM_TEAMS(int KMP_DEREF num_teams) { if (!__kmp_init_serial) { __kmp_serial_initialize(); } - kmp_info_t *th = __kmp_entry_thread(); - // OpenMP 5.1, Section 3.4.3: omp_set_num_teams may not be called from - // within a parallel region other than the implicit parallel region. - // Also guard against calls from within a teams region: nteams-var is a - // device-scoped ICV and concurrent modification from multiple team initial - // threads may race. - // t_level counts both active and serialized parallel levels (0 at the - // implicit top-level parallel region), so this catches all non-implicit - // parallel regions. - if (th->th.th_teams_microtask || th->th.th_team->t.t_level > 0) { - KMP_WARNING(SetNumTeamsInParOrTeamsRegion, "omp_set_num_teams"); - return; - } __kmp_set_num_teams(KMP_DEREF num_teams); #endif } - int FTN_STDCALL FTN_GET_MAX_TEAMS(void) { #ifdef KMP_STUB return 1; @@ -1671,24 +1657,9 @@ void FTN_STDCALL FTN_SET_TEAMS_THREAD_LIMIT(int KMP_DEREF limit) { if (!__kmp_init_serial) { __kmp_serial_initialize(); } - kmp_info_t *th = __kmp_entry_thread(); - // OpenMP 5.1, Section 3.4.5: omp_set_teams_thread_limit may not be called - // from within a parallel region other than the implicit parallel region. - // Also guard against calls from within a teams region: - // teams-thread-limit-var is a device-scoped ICV and concurrent modification - // from multiple team initial threads may race. - // t_level counts both active and serialized parallel levels (0 at the - // implicit top-level parallel region), so this catches all non-implicit - // parallel regions. - if (th->th.th_teams_microtask || th->th.th_team->t.t_level > 0) { - KMP_WARNING(SetTeamsThreadLimitInParOrTeamsRegion, - "omp_set_teams_thread_limit"); - return; - } __kmp_set_teams_thread_limit(KMP_DEREF limit); #endif } - int FTN_STDCALL FTN_GET_TEAMS_THREAD_LIMIT(void) { #ifdef KMP_STUB return 1; diff --git a/system/lib/openmp/src/kmp_global.cpp b/system/lib/openmp/src/kmp_global.cpp index 15b9babfaf0ba..6c3b576cab405 100644 --- a/system/lib/openmp/src/kmp_global.cpp +++ b/system/lib/openmp/src/kmp_global.cpp @@ -333,8 +333,6 @@ omp_memspace_handle_t const omp_high_bw_mem_space = (omp_memspace_handle_t const)3; omp_memspace_handle_t const omp_low_lat_mem_space = (omp_memspace_handle_t const)4; -omp_memspace_handle_t const omp_cgroup_mem_space = - (omp_memspace_handle_t const)5; omp_memspace_handle_t const llvm_omp_target_host_mem_space = (omp_memspace_handle_t const)100; omp_memspace_handle_t const llvm_omp_target_shared_mem_space = @@ -553,7 +551,7 @@ int __kmp_nesting_mode = 0; int __kmp_nesting_mode_nlevels = 1; int *__kmp_nesting_nth_level; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // TDG record & replay int __kmp_tdg_dot = 0; kmp_int32 __kmp_max_tdgs = 100; diff --git a/system/lib/openmp/src/kmp_invoke_microtask.cpp b/system/lib/openmp/src/kmp_invoke_microtask.cpp deleted file mode 100644 index f14f27cc06ee3..0000000000000 --- a/system/lib/openmp/src/kmp_invoke_microtask.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "kmp.h" - -#if !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_MIC || KMP_ARCH_AARCH64 || \ - KMP_ARCH_PPC64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \ - KMP_ARCH_ARM || KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_PPC_XCOFF || \ - KMP_ARCH_AARCH64_32) - -// Because WebAssembly will use `call_indirect` to invoke the microtask and -// WebAssembly indirect calls check that the called signature is a precise -// match, we need to cast each microtask function pointer back from `void *` to -// its original type. -typedef void (*microtask_t0)(int *, int *); -typedef void (*microtask_t1)(int *, int *, void *); -typedef void (*microtask_t2)(int *, int *, void *, void *); -typedef void (*microtask_t3)(int *, int *, void *, void *, void *); -typedef void (*microtask_t4)(int *, int *, void *, void *, void *, void *); -typedef void (*microtask_t5)(int *, int *, void *, void *, void *, void *, - void *); -typedef void (*microtask_t6)(int *, int *, void *, void *, void *, void *, - void *, void *); -typedef void (*microtask_t7)(int *, int *, void *, void *, void *, void *, - void *, void *, void *); -typedef void (*microtask_t8)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *); -typedef void (*microtask_t9)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *); -typedef void (*microtask_t10)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *, void *); -typedef void (*microtask_t11)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *, void *, - void *); -typedef void (*microtask_t12)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *, void *, - void *, void *); -typedef void (*microtask_t13)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *, void *, - void *, void *, void *); -typedef void (*microtask_t14)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *, void *, - void *, void *, void *, void *); -typedef void (*microtask_t15)(int *, int *, void *, void *, void *, void *, - void *, void *, void *, void *, void *, void *, - void *, void *, void *, void *, void *); - -// we really only need the case with 1 argument, because CLANG always build -// a struct of pointers to shared variables referenced in the outlined function -int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int tid, int argc, - void *p_argv[] -#if OMPT_SUPPORT - , - void **exit_frame_ptr -#endif -) { -#if OMPT_SUPPORT - *exit_frame_ptr = OMPT_GET_FRAME_ADDRESS(0); -#endif - - switch (argc) { - default: - fprintf(stderr, "Too many args to microtask: %d!\n", argc); - fflush(stderr); - exit(-1); - case 0: - (*(microtask_t0)pkfn)(>id, &tid); - break; - case 1: - (*(microtask_t1)pkfn)(>id, &tid, p_argv[0]); - break; - case 2: - (*(microtask_t2)pkfn)(>id, &tid, p_argv[0], p_argv[1]); - break; - case 3: - (*(microtask_t3)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2]); - break; - case 4: - (*(microtask_t4)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3]); - break; - case 5: - (*(microtask_t5)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4]); - break; - case 6: - (*(microtask_t6)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5]); - break; - case 7: - (*(microtask_t7)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6]); - break; - case 8: - (*(microtask_t8)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7]); - break; - case 9: - (*(microtask_t9)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], p_argv[7], - p_argv[8]); - break; - case 10: - (*(microtask_t10)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7], p_argv[8], p_argv[9]); - break; - case 11: - (*(microtask_t11)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7], p_argv[8], p_argv[9], p_argv[10]); - break; - case 12: - (*(microtask_t12)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7], p_argv[8], p_argv[9], p_argv[10], - p_argv[11]); - break; - case 13: - (*(microtask_t13)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7], p_argv[8], p_argv[9], p_argv[10], - p_argv[11], p_argv[12]); - break; - case 14: - (*(microtask_t14)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7], p_argv[8], p_argv[9], p_argv[10], - p_argv[11], p_argv[12], p_argv[13]); - break; - case 15: - (*(microtask_t15)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], - p_argv[3], p_argv[4], p_argv[5], p_argv[6], - p_argv[7], p_argv[8], p_argv[9], p_argv[10], - p_argv[11], p_argv[12], p_argv[13], p_argv[14]); - break; - } - - return 1; -} - -#endif diff --git a/system/lib/openmp/src/kmp_os.h b/system/lib/openmp/src/kmp_os.h index c5da19dc2407b..e8ad2a6fdb78e 100644 --- a/system/lib/openmp/src/kmp_os.h +++ b/system/lib/openmp/src/kmp_os.h @@ -153,7 +153,7 @@ typedef struct kmp_struct64 kmp_uint64; #undef KMP_USE_X87CONTROL #define KMP_USE_X87CONTROL 1 #endif -#if KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM64EC +#if KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 #define KMP_INTPTR 1 typedef __int64 kmp_intptr_t; typedef unsigned __int64 kmp_uintptr_t; @@ -183,7 +183,7 @@ typedef unsigned long long kmp_uint64; #define KMP_SIZE_T_SPEC KMP_UINT32_SPEC #elif KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || \ KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \ - KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_SPARC64 || KMP_ARCH_ARM64EC + KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_SPARC64 #define KMP_SIZE_T_SPEC KMP_UINT64_SPEC #else #error "Can't determine size_t printf format specifier." @@ -464,9 +464,7 @@ enum kmp_mem_fence_type { // Synchronization primitives -#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && \ - !((KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC) && \ - (KMP_COMPILER_CLANG || KMP_COMPILER_GCC)) +#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && !((KMP_ARCH_AARCH64 || KMP_ARCH_ARM) && (KMP_COMPILER_CLANG || KMP_COMPILER_GCC)) #if KMP_MSVC_COMPAT && !KMP_COMPILER_CLANG #pragma intrinsic(InterlockedExchangeAdd) @@ -1055,7 +1053,7 @@ extern kmp_real64 __kmp_xchg_real64(volatile kmp_real64 *p, kmp_real64 v); #if KMP_ARCH_PPC64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS || \ KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \ KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_PPC || KMP_ARCH_AARCH64_32 || \ - KMP_ARCH_SPARC || KMP_ARCH_ARM64EC + KMP_ARCH_SPARC #if KMP_OS_WINDOWS #undef KMP_MB #define KMP_MB() std::atomic_thread_fence(std::memory_order_seq_cst) diff --git a/system/lib/openmp/src/kmp_platform.h b/system/lib/openmp/src/kmp_platform.h index 7d88c02e9cf37..609b7c4688842 100644 --- a/system/lib/openmp/src/kmp_platform.h +++ b/system/lib/openmp/src/kmp_platform.h @@ -119,7 +119,6 @@ #define KMP_ARCH_X86_64 0 #define KMP_ARCH_AARCH64 0 #define KMP_ARCH_AARCH64_32 0 -#define KMP_ARCH_ARM64EC 0 #define KMP_ARCH_PPC64_ELFv1 0 #define KMP_ARCH_PPC64_ELFv2 0 #define KMP_ARCH_PPC64_XCOFF 0 @@ -134,10 +133,7 @@ #define KMP_ARCH_SPARC 0 #if KMP_OS_WINDOWS -#if defined(_M_ARM64EC) || defined(__arm64ec__) -#undef KMP_ARCH_ARM64EC -#define KMP_ARCH_ARM64EC 1 -#elif defined(_M_AMD64) || defined(__x86_64) +#if defined(_M_AMD64) || defined(__x86_64) #undef KMP_ARCH_X86_64 #define KMP_ARCH_X86_64 1 #elif defined(__aarch64__) || defined(_M_ARM64) @@ -295,7 +291,7 @@ KMP_ARCH_AARCH64 + KMP_ARCH_MIPS + KMP_ARCH_MIPS64 + \ KMP_ARCH_RISCV64 + KMP_ARCH_LOONGARCH64 + KMP_ARCH_VE + \ KMP_ARCH_S390X + KMP_ARCH_WASM + KMP_ARCH_PPC + \ - KMP_ARCH_AARCH64_32 + KMP_ARCH_SPARC + KMP_ARCH_ARM64EC) + KMP_ARCH_AARCH64_32 + KMP_ARCH_SPARC) #error Unknown or unsupported architecture #endif diff --git a/system/lib/openmp/src/kmp_runtime.cpp b/system/lib/openmp/src/kmp_runtime.cpp index c402645af9ad6..48e29c9f9fe45 100644 --- a/system/lib/openmp/src/kmp_runtime.cpp +++ b/system/lib/openmp/src/kmp_runtime.cpp @@ -6747,7 +6747,7 @@ void __kmp_register_library_startup(void) { } } if (__kmp_shm_available && shm_preexist == 0) { // SHM created, set size - if (ftruncate(fd1, SHM_SIZE) == -1) { // error occurred setting size; + if (ftruncate(fd1, SHM_SIZE) == -1) { // error occured setting size; KMP_WARNING(FunctionError, "Can't set size of SHM"); __kmp_shm_available = false; } @@ -6796,7 +6796,7 @@ void __kmp_register_library_startup(void) { } if (__kmp_tmp_available && tmp_preexist == 0) { // we created /tmp file now set size - if (ftruncate(fd1, SHM_SIZE) == -1) { // error occurred setting size; + if (ftruncate(fd1, SHM_SIZE) == -1) { // error occured setting size; KMP_WARNING(FunctionError, "Can't set size of /tmp file"); __kmp_tmp_available = false; } @@ -8924,7 +8924,7 @@ __kmp_determine_reduction_method( #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || \ KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \ - KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_WASM || KMP_ARCH_ARM64EC + KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_WASM #if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \ KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HAIKU || \ diff --git a/system/lib/openmp/src/kmp_settings.cpp b/system/lib/openmp/src/kmp_settings.cpp index 66ef6f8097dce..b6e7e9cadfe60 100644 --- a/system/lib/openmp/src/kmp_settings.cpp +++ b/system/lib/openmp/src/kmp_settings.cpp @@ -1266,7 +1266,7 @@ static void __kmp_stg_parse_num_threads(char const *name, char const *value, K_DIAG(1, ("__kmp_dflt_team_nth == %d\n", __kmp_dflt_team_nth)); } // __kmp_stg_parse_num_threads -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH static void __kmp_stg_parse_max_tdgs(char const *name, char const *value, void *data) { __kmp_stg_parse_int(name, value, 0, INT_MAX, &__kmp_max_tdgs); @@ -5742,7 +5742,7 @@ static kmp_setting_t __kmp_stg_table[] = { {"LIBOMP_NUM_HIDDEN_HELPER_THREADS", __kmp_stg_parse_num_hidden_helper_threads, __kmp_stg_print_num_hidden_helper_threads, NULL, 0, 0}, -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH {"KMP_MAX_TDGS", __kmp_stg_parse_max_tdgs, __kmp_std_print_max_tdgs, NULL, 0, 0}, {"KMP_TDG_DOT", __kmp_stg_parse_tdg_dot, __kmp_stg_print_tdg_dot, NULL, 0, diff --git a/system/lib/openmp/src/kmp_str.cpp b/system/lib/openmp/src/kmp_str.cpp index 83387678f6b73..12cce53074821 100644 --- a/system/lib/openmp/src/kmp_str.cpp +++ b/system/lib/openmp/src/kmp_str.cpp @@ -619,13 +619,13 @@ char *__kmp_str_token( return token; } // __kmp_str_token -int __kmp_basic_str_to_int(char const *str, size_t maxlen) { +int __kmp_basic_str_to_int(char const *str) { int result; char const *t; result = 0; - for (t = str; *t != '\0' && maxlen > 0; ++t, --maxlen) { + for (t = str; *t != '\0'; ++t) { if (*t < '0' || *t > '9') break; // Cap parsing to create largest integer diff --git a/system/lib/openmp/src/kmp_str.h b/system/lib/openmp/src/kmp_str.h index 9b0d2bbd56960..11f633cd8024f 100644 --- a/system/lib/openmp/src/kmp_str.h +++ b/system/lib/openmp/src/kmp_str.h @@ -13,7 +13,6 @@ #ifndef KMP_STR_H #define KMP_STR_H -#include #include #include @@ -113,7 +112,7 @@ int __kmp_str_match_true(char const *data); void __kmp_str_replace(char *str, char search_for, char replace_with); void __kmp_str_split(char *str, char delim, char **head, char **tail); char *__kmp_str_token(char *str, char const *delim, char **buf); -int __kmp_basic_str_to_int(char const *str, size_t maxlen = SIZE_MAX); +int __kmp_basic_str_to_int(char const *str); int __kmp_str_to_int(char const *str, char sentinel); void __kmp_str_to_size(char const *str, size_t *out, size_t dfactor, diff --git a/system/lib/openmp/src/kmp_stub.cpp b/system/lib/openmp/src/kmp_stub.cpp index 4c1e6099574a6..06276d1bed1c7 100644 --- a/system/lib/openmp/src/kmp_stub.cpp +++ b/system/lib/openmp/src/kmp_stub.cpp @@ -368,8 +368,6 @@ omp_memspace_handle_t const omp_high_bw_mem_space = (omp_memspace_handle_t const)3; omp_memspace_handle_t const omp_low_lat_mem_space = (omp_memspace_handle_t const)4; -omp_memspace_handle_t const omp_cgroup_mem_space = - (omp_memspace_handle_t const)5; omp_memspace_handle_t const llvm_omp_target_host_mem_space = (omp_memspace_handle_t const)100; omp_memspace_handle_t const llvm_omp_target_shared_mem_space = @@ -456,31 +454,6 @@ void omp_free(void *ptr, omp_allocator_handle_t allocator) { #endif } -void *omp_get_dyn_gprivate_ptr(size_t offset, omp_access_t access_group) { - i; - return NULL; -} - -void *omp_get_dyn_gprivate_nofb_ptr(size_t offset, omp_access_t access_group) { - i; - return NULL; -} - -size_t omp_get_dyn_gprivate_size(omp_access_t access_group) { - i; - return 0; -} - -omp_memspace_handle_t omp_get_dyn_gprivate_memspace(omp_access_t access_group) { - i; - return omp_null_mem_space; -} - -size_t omp_get_gprivate_limit(int device_num, omp_access_t access_group) { - i; - return 0; -} - /* OpenMP 5.0 Affinity Format */ void omp_set_affinity_format(char const *format) { i; } size_t omp_get_affinity_format(char *buffer, size_t size) { diff --git a/system/lib/openmp/src/kmp_taskdeps.cpp b/system/lib/openmp/src/kmp_taskdeps.cpp index b1a0848fc722f..abbca752f0587 100644 --- a/system/lib/openmp/src/kmp_taskdeps.cpp +++ b/system/lib/openmp/src/kmp_taskdeps.cpp @@ -222,7 +222,7 @@ static kmp_depnode_list_t *__kmp_add_node(kmp_info_t *thread, static inline void __kmp_track_dependence(kmp_int32 gtid, kmp_depnode_t *source, kmp_depnode_t *sink, kmp_task_t *sink_task) { -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_taskdata_t *task_source = KMP_TASK_TO_TASKDATA(source->dn.task); kmp_taskdata_t *task_sink = KMP_TASK_TO_TASKDATA(sink_task); if (source->dn.task && sink_task) { @@ -311,7 +311,7 @@ __kmp_depnode_link_successor(kmp_int32 gtid, kmp_info_t *thread, // link node as successor of list elements for (kmp_depnode_list_t *p = plist; p; p = p->next) { kmp_depnode_t *dep = p->node; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_tdg_status tdg_status = KMP_TDG_NONE; if (task) { kmp_taskdata_t *td = KMP_TASK_TO_TASKDATA(task); @@ -325,7 +325,7 @@ __kmp_depnode_link_successor(kmp_int32 gtid, kmp_info_t *thread, KMP_ACQUIRE_DEPNODE(gtid, dep); if (dep->dn.task) { if (!dep->dn.successors || dep->dn.successors->node != node) { -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (!(__kmp_tdg_is_recording(tdg_status)) && task) #endif __kmp_track_dependence(gtid, dep, node, task); @@ -352,7 +352,7 @@ static inline kmp_int32 __kmp_depnode_link_successor(kmp_int32 gtid, if (!sink) return 0; kmp_int32 npredecessors = 0; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_tdg_status tdg_status = KMP_TDG_NONE; kmp_taskdata_t *td = KMP_TASK_TO_TASKDATA(task); if (task) { @@ -367,7 +367,7 @@ static inline kmp_int32 __kmp_depnode_link_successor(kmp_int32 gtid, KMP_ACQUIRE_DEPNODE(gtid, sink); if (sink->dn.task) { if (!sink->dn.successors || sink->dn.successors->node != source) { -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (!(__kmp_tdg_is_recording(tdg_status)) && task) #endif __kmp_track_dependence(gtid, sink, source, task); @@ -376,7 +376,7 @@ static inline kmp_int32 __kmp_depnode_link_successor(kmp_int32 gtid, "%p\n", gtid, KMP_TASK_TO_TASKDATA(sink->dn.task), KMP_TASK_TO_TASKDATA(task))); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (__kmp_tdg_is_recording(tdg_status)) { kmp_taskdata_t *tdd = KMP_TASK_TO_TASKDATA(sink->dn.task); if (tdd->is_taskgraph) { @@ -694,7 +694,7 @@ kmp_int32 __kmpc_omp_task_with_deps(ident_t *loc_ref, kmp_int32 gtid, kmp_info_t *thread = __kmp_threads[gtid]; kmp_taskdata_t *current_task = thread->th.th_current_task; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // record TDG with deps if (new_taskdata->is_taskgraph && __kmp_tdg_is_recording(new_taskdata->tdg->tdg_status)) { @@ -714,7 +714,7 @@ kmp_int32 __kmpc_omp_task_with_deps(ident_t *loc_ref, kmp_int32 gtid, __kmp_free(old_record); - for (kmp_uint i = old_size; i < new_size; i++) { + for (kmp_int i = old_size; i < new_size; i++) { kmp_int32 *successorsList = (kmp_int32 *)__kmp_allocate( __kmp_successors_size * sizeof(kmp_int32)); new_record[i].task = nullptr; diff --git a/system/lib/openmp/src/kmp_taskdeps.h b/system/lib/openmp/src/kmp_taskdeps.h index 0792baf67f162..f6bfb39218a21 100644 --- a/system/lib/openmp/src/kmp_taskdeps.h +++ b/system/lib/openmp/src/kmp_taskdeps.h @@ -96,7 +96,7 @@ extern void __kmpc_give_task(kmp_task_t *ptask, kmp_int32 start); static inline void __kmp_release_deps(kmp_int32 gtid, kmp_taskdata_t *task) { -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (task->is_taskgraph && !(__kmp_tdg_is_recording(task->tdg->tdg_status))) { kmp_node_info_t *TaskInfo = &(task->tdg->record_map[task->td_tdg_task_id]); @@ -140,7 +140,7 @@ static inline void __kmp_release_deps(kmp_int32 gtid, kmp_taskdata_t *task) { gtid, task)); KMP_ACQUIRE_DEPNODE(gtid, node); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (!task->is_taskgraph || (task->is_taskgraph && !__kmp_tdg_is_recording(task->tdg->tdg_status))) #endif diff --git a/system/lib/openmp/src/kmp_tasking.cpp b/system/lib/openmp/src/kmp_tasking.cpp index be42ed6f76abc..37836fb457537 100644 --- a/system/lib/openmp/src/kmp_tasking.cpp +++ b/system/lib/openmp/src/kmp_tasking.cpp @@ -37,7 +37,7 @@ static void __kmp_alloc_task_deque(kmp_info_t *thread, static int __kmp_realloc_task_threads_data(kmp_info_t *thread, kmp_task_team_t *task_team); static void __kmp_bottom_half_finish_proxy(kmp_int32 gtid, kmp_task_t *ptask); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH static kmp_tdg_info_t *__kmp_find_tdg(kmp_int32 tdg_id); int __kmp_taskloop_task(int gtid, void *ptask); #endif @@ -70,7 +70,7 @@ static bool __kmp_task_is_allowed(int gtid, const kmp_int32 is_constrained, } // Check mutexinoutset dependencies, acquire locks kmp_depnode_t *node = tasknew->td_depnode; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (!tasknew->is_taskgraph && UNLIKELY(node && (node->dn.mtx_num_locks > 0))) { #else if (UNLIKELY(node && (node->dn.mtx_num_locks > 0))) { @@ -665,7 +665,7 @@ static void __kmp_free_task(kmp_int32 gtid, kmp_taskdata_t *taskdata, task->data2.priority = 0; taskdata->td_flags.freed = 1; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // do not free tasks in taskgraph if (!taskdata->is_taskgraph) { #endif @@ -675,7 +675,7 @@ static void __kmp_free_task(kmp_int32 gtid, kmp_taskdata_t *taskdata, #else /* ! USE_FAST_MEMORY */ __kmp_thread_free(thread, taskdata); #endif -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH } else { taskdata->td_flags.complete = 0; taskdata->td_flags.started = 0; @@ -779,7 +779,7 @@ static bool __kmp_track_children_task(kmp_taskdata_t *taskdata) { flags.detachable == TASK_DETACHABLE || flags.hidden_helper; ret = ret || KMP_ATOMIC_LD_ACQ(&taskdata->td_parent->td_incomplete_child_tasks) > 0; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (taskdata->td_taskgroup && taskdata->is_taskgraph) ret = ret || KMP_ATOMIC_LD_ACQ(&taskdata->td_taskgroup->count) > 0; #endif @@ -802,7 +802,7 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, kmp_info_t *thread = __kmp_threads[gtid]; kmp_task_team_t *task_team = thread->th.th_task_team; // might be NULL for serial teams... -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // to avoid seg fault when we need to access taskdata->td_flags after free when using vanilla taskloop bool is_taskgraph; #endif @@ -815,7 +815,7 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, KMP_DEBUG_ASSERT(taskdata->td_flags.tasktype == TASK_EXPLICIT); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH is_taskgraph = taskdata->is_taskgraph; #endif @@ -923,7 +923,7 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, if (completed) { taskdata->td_flags.complete = 1; // mark the task as completed -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH taskdata->td_flags.onced = 1; // mark the task as ran once already #endif @@ -942,7 +942,7 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, #endif KMP_ATOMIC_DEC(&taskdata->td_parent->td_incomplete_child_tasks); KMP_DEBUG_ASSERT(children >= 0); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (taskdata->td_taskgroup && !taskdata->is_taskgraph) #else if (taskdata->td_taskgroup) @@ -985,7 +985,7 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, // KMP_DEBUG_ASSERT( resumed_task->td_flags.executing == 0 ); resumed_task->td_flags.executing = 1; // resume previous task -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (is_taskgraph && __kmp_track_children_task(taskdata) && taskdata->td_taskgroup) { // TDG: we only release taskgroup barrier here because @@ -1113,7 +1113,7 @@ void __kmp_init_implicit_task(ident_t *loc_ref, kmp_info_t *this_thr, task->td_flags.executing = 1; task->td_flags.complete = 0; task->td_flags.freed = 0; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH task->td_flags.onced = 0; #endif @@ -1159,7 +1159,7 @@ void __kmp_finish_implicit_task(kmp_info_t *thread) { if (task->td_dephash) { int children; task->td_flags.complete = 1; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH task->td_flags.onced = 1; #endif children = KMP_ATOMIC_LD_ACQ(&task->td_incomplete_child_tasks); @@ -1390,7 +1390,7 @@ kmp_task_t *__kmp_task_alloc(ident_t *loc_ref, kmp_int32 gtid, taskdata->td_flags.executing = 0; taskdata->td_flags.complete = 0; taskdata->td_flags.freed = 0; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH taskdata->td_flags.onced = 0; taskdata->is_taskgraph = 0; taskdata->tdg = nullptr; @@ -1430,7 +1430,7 @@ kmp_task_t *__kmp_task_alloc(ident_t *loc_ref, kmp_int32 gtid, } } -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx); if (tdg && __kmp_tdg_is_recording(tdg->tdg_status) && (task_entry != (kmp_routine_entry_t)__kmp_taskloop_task)) { @@ -1505,18 +1505,6 @@ kmp_int32 __kmpc_omp_reg_task_with_affinity(ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *new_task, kmp_int32 naffins, kmp_task_affinity_info_t *affin_list) { - if (naffins > 0) - KMP_DEBUG_ASSERT(affin_list != NULL); - - for (kmp_int32 i = 0; i < naffins; ++i) { - KA_TRACE(30, ("__kmpc_omp_reg_task_with_affinity: T#%d aff[%d] " - "base_addr=0x%llx len=%zu flags={%d,%d,%d}\n", - gtid, i, (unsigned long long)affin_list[i].base_addr, - affin_list[i].len, (int)affin_list[i].flags.flag1, - (int)affin_list[i].flags.flag2, - (int)affin_list[i].flags.reserved)); - } - return 0; } @@ -1807,7 +1795,7 @@ kmp_int32 __kmp_omp_task(kmp_int32 gtid, kmp_task_t *new_task, bool serialize_immediate) { kmp_taskdata_t *new_taskdata = KMP_TASK_TO_TASKDATA(new_task); -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (new_taskdata->is_taskgraph && __kmp_tdg_is_recording(new_taskdata->tdg->tdg_status)) { kmp_tdg_info_t *tdg = new_taskdata->tdg; @@ -1828,7 +1816,7 @@ kmp_int32 __kmp_omp_task(kmp_int32 gtid, kmp_task_t *new_task, __kmp_free(old_record); - for (kmp_uint i = old_size; i < new_size; i++) { + for (kmp_int i = old_size; i < new_size; i++) { kmp_int32 *successorsList = (kmp_int32 *)__kmp_allocate( __kmp_successors_size * sizeof(kmp_int32)); new_record[i].task = nullptr; @@ -2376,7 +2364,7 @@ the reduction either does not use omp_orig object, or the omp_orig is accessible without help of the runtime library. */ void *__kmpc_task_reduction_init(int gtid, int num, void *data) { -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx); if (tdg && __kmp_tdg_is_recording(tdg->tdg_status)) { kmp_tdg_info_t *this_tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx]; @@ -2403,7 +2391,7 @@ Note: this entry supposes the optional compiler-generated initializer routine has two parameters, pointer to object to be initialized and pointer to omp_orig */ void *__kmpc_taskred_init(int gtid, int num, void *data) { -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx); if (tdg && __kmp_tdg_is_recording(tdg->tdg_status)) { kmp_tdg_info_t *this_tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx]; @@ -2460,7 +2448,7 @@ void *__kmpc_task_reduction_get_th_data(int gtid, void *tskgrp, void *data) { kmp_int32 num; kmp_int32 tid = thread->th.th_info.ds.ds_tid; -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if ((thread->th.th_current_task->is_taskgraph) && (!__kmp_tdg_is_recording( __kmp_global_tdgs[__kmp_curr_tdg_idx]->tdg_status))) { @@ -4238,7 +4226,7 @@ static void __kmp_first_top_half_finish_proxy(kmp_taskdata_t *taskdata) { KMP_DEBUG_ASSERT(taskdata->td_flags.freed == 0); taskdata->td_flags.complete = 1; // mark the task as completed -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH taskdata->td_flags.onced = 1; #endif @@ -4443,9 +4431,8 @@ void __kmp_fulfill_event(kmp_event_t *event) { // indicating whether we need to update task->td_task_id // returns: a pointer to the allocated kmp_task_t structure (task). kmp_task_t *__kmp_task_dup_alloc(kmp_info_t *thread, kmp_task_t *task_src -#if OMP_TASKGRAPH_EXPERIMENTAL - , - int taskloop_recur +#if OMPX_TASKGRAPH + , int taskloop_recur #endif ) { kmp_task_t *task; @@ -4475,7 +4462,7 @@ kmp_task_t *__kmp_task_dup_alloc(kmp_info_t *thread, kmp_task_t *task_src task = KMP_TASKDATA_TO_TASK(taskdata); // Initialize new task (only specific fields not affected by memcpy) -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH if (taskdata->is_taskgraph && !taskloop_recur && __kmp_tdg_is_recording(taskdata_src->tdg->tdg_status)) taskdata->td_tdg_task_id = KMP_ATOMIC_INC(&__kmp_tdg_task_id); @@ -4708,7 +4695,7 @@ void __kmp_taskloop_linear(ident_t *loc, int gtid, kmp_task_t *task, } } -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH next_task = __kmp_task_dup_alloc(thread, task, /* taskloop_recur */ 0); #else next_task = __kmp_task_dup_alloc(thread, task); // allocate new task @@ -4910,7 +4897,7 @@ void __kmp_taskloop_recur(ident_t *loc, int gtid, kmp_task_t *task, lb1 = ub0 + st; // create pattern task for 2nd half of the loop -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH next_task = __kmp_task_dup_alloc(thread, task, /* taskloop_recur */ 1); #else @@ -4948,7 +4935,7 @@ void __kmp_taskloop_recur(ident_t *loc, int gtid, kmp_task_t *task, p->codeptr_ra = codeptr_ra; #endif -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH kmp_taskdata_t *new_task_data = KMP_TASK_TO_TASKDATA(new_task); new_task_data->tdg = taskdata->tdg; new_task_data->is_taskgraph = 0; @@ -4993,7 +4980,7 @@ static void __kmp_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, __kmpc_taskgroup(loc, gtid); } -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH KMP_ATOMIC_DEC(&__kmp_tdg_task_id); #endif // ========================================================================= @@ -5244,7 +5231,7 @@ bool __kmpc_omp_has_task_team(kmp_int32 gtid) { return taskdata->td_task_team != NULL; } -#if OMP_TASKGRAPH_EXPERIMENTAL +#if OMPX_TASKGRAPH // __kmp_find_tdg: identify a TDG through its ID // tdg_id: ID of the TDG // returns: If a TDG corresponding to this ID is found and not diff --git a/system/lib/openmp/src/ompd-specific.cpp b/system/lib/openmp/src/ompd-specific.cpp index 82ffe652f3caa..c4018789eb5b2 100644 --- a/system/lib/openmp/src/ompd-specific.cpp +++ b/system/lib/openmp/src/ompd-specific.cpp @@ -81,25 +81,17 @@ void ompd_init() { char *libname = NULL; - const char *ompd_env_var = getenv("OMP_DEBUG"); - int ompd_debug = ompd_env_var && !strcmp(ompd_env_var, "enabled"); - #if KMP_OS_UNIX // Find the location of libomp.so thru dladdr and replace the libomp with // libompd to get the full path of libompd Dl_info dl_info; int ret = dladdr((void *)ompd_init, &dl_info); if (!ret) { - const char *err = dlerror(); - if (ompd_debug || err) - fprintf(stderr, - "The OpenMP runtime could not determine the location of " - "libompd.so. If the debugger fails to load the library, make " - "sure to add the directory containing a compatible libompd.so " - "to your LD_LIBRARY_PATH%s%s\n", - err ? ": " : "", err ? err : ""); - } else if (dl_info.dli_fname && strrchr(dl_info.dli_fname, '/')) { - int lib_path_length = strrchr(dl_info.dli_fname, '/') - dl_info.dli_fname; + fprintf(stderr, "%s\n", dlerror()); + } + int lib_path_length; + if (strrchr(dl_info.dli_fname, '/')) { + lib_path_length = strrchr(dl_info.dli_fname, '/') - dl_info.dli_fname; libname = (char *)malloc(lib_path_length + 12 /*for '/libompd.so' and '\0'*/); strncpy(libname, dl_info.dli_fname, lib_path_length); @@ -107,7 +99,8 @@ void ompd_init() { } #endif - if (ompd_debug) { + const char *ompd_env_var = getenv("OMP_DEBUG"); + if (ompd_env_var && !strcmp(ompd_env_var, "enabled")) { fprintf(stderr, "OMP_OMPD active\n"); ompt_enabled.enabled = 1; ompd_state |= OMPD_ENABLE_BP; diff --git a/system/lib/openmp/src/ompt-general.cpp b/system/lib/openmp/src/ompt-general.cpp index a708a8d76fcf4..1a778e4ecac3a 100644 --- a/system/lib/openmp/src/ompt-general.cpp +++ b/system/lib/openmp/src/ompt-general.cpp @@ -468,7 +468,7 @@ void ompt_pre_init() { #endif } -#define omp_initial_device -1 /* see omp.h.var */ +extern "C" int omp_get_initial_device(void); void ompt_post_init() { //-------------------------------------------------- @@ -486,7 +486,7 @@ void ompt_post_init() { //-------------------------------------------------- if (ompt_start_tool_result) { ompt_enabled.enabled = !!ompt_start_tool_result->initialize( - ompt_fn_lookup, omp_initial_device, + ompt_fn_lookup, omp_get_initial_device(), &(ompt_start_tool_result->tool_data)); if (!ompt_enabled.enabled) { @@ -864,10 +864,8 @@ OMPT_API_ROUTINE int ompt_get_target_info(uint64_t *device_num, return 0; // thread is not in a target region } -extern "C" int omp_get_num_devices(void); - OMPT_API_ROUTINE int ompt_get_num_devices(void) { - return omp_get_num_devices(); + return 1; // only one device (the current device) is available } /***************************************************************************** @@ -931,8 +929,7 @@ _OMP_EXTERN void ompt_libomp_connect(ompt_start_tool_result_t *result) { // functions can be extracted and assigned to the callbacks in // libomptarget result->initialize(ompt_libomp_target_fn_lookup, - /* initial_device_num */ omp_initial_device, - /* tool_data */ nullptr); + /* initial_device_num */ 0, /* tool_data */ nullptr); // Track the object provided by libomptarget so that the finalizer can be // called during OMPT finalization libomptarget_ompt_result = result; diff --git a/system/lib/openmp/src/thirdparty/ittnotify/ittnotify_config.h b/system/lib/openmp/src/thirdparty/ittnotify/ittnotify_config.h index c2120a017f5d2..bd3fd9b43e574 100644 --- a/system/lib/openmp/src/thirdparty/ittnotify/ittnotify_config.h +++ b/system/lib/openmp/src/thirdparty/ittnotify/ittnotify_config.h @@ -173,8 +173,6 @@ #ifndef ITT_ARCH #if defined _M_IX86 || defined __i386__ #define ITT_ARCH ITT_ARCH_IA32 -#elif defined _M_ARM64EC || defined __arm64ec__ -#define ITT_ARCH ITT_ARCH_ARM64 #elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__ #define ITT_ARCH ITT_ARCH_IA32E #elif defined _M_IA64 || defined __ia64__ diff --git a/system/lib/openmp/src/z_Linux_asm.S b/system/lib/openmp/src/z_Linux_asm.S index 867cb3024921d..12fea67e000e8 100644 --- a/system/lib/openmp/src/z_Linux_asm.S +++ b/system/lib/openmp/src/z_Linux_asm.S @@ -121,7 +121,7 @@ KMP_PREFIX_UNDERSCORE(\proc): # endif // KMP_OS_DARWIN #endif // KMP_ARCH_X86 || KMP_ARCH_x86_64 -#if KMP_ARCH_AARCH64 || KMP_ARCH_AARCH64_32 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC +#if KMP_ARCH_AARCH64 || KMP_ARCH_AARCH64_32 || KMP_ARCH_ARM # if KMP_OS_DARWIN # define KMP_PREFIX_UNDERSCORE(x) _##x // extra underscore for OS X* symbols diff --git a/system/lib/openmp/src/z_Linux_util.cpp b/system/lib/openmp/src/z_Linux_util.cpp index f42fc68488c91..c7fe0642cea63 100644 --- a/system/lib/openmp/src/z_Linux_util.cpp +++ b/system/lib/openmp/src/z_Linux_util.cpp @@ -446,7 +446,7 @@ void __kmp_terminate_thread(int gtid) { if (!th) return; -#if KMP_CANCEL_THREADS +#ifdef KMP_CANCEL_THREADS KA_TRACE(10, ("__kmp_terminate_thread: kill (%d)\n", gtid)); status = pthread_cancel(th->th.th_info.ds.ds_thread); if (status != 0 && status != ESRCH) { @@ -558,7 +558,7 @@ static void *__kmp_launch_worker(void *thr) { __kmp_affinity_bind_init_mask(gtid); #endif -#if KMP_CANCEL_THREADS +#ifdef KMP_CANCEL_THREADS status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old_type); KMP_CHECK_SYSFAIL("pthread_setcanceltype", status); // josh todo: isn't PTHREAD_CANCEL_ENABLE default for newly-created threads? @@ -636,7 +636,7 @@ static void *__kmp_launch_monitor(void *thr) { __kmp_check_stack_overlap((kmp_info_t *)thr); -#if KMP_CANCEL_THREADS +#ifdef KMP_CANCEL_THREADS status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old_type); KMP_CHECK_SYSFAIL("pthread_setcanceltype", status); // josh todo: isn't PTHREAD_CANCEL_ENABLE default for newly-created threads? @@ -1274,7 +1274,7 @@ void __kmp_remove_signals(void) { #endif // KMP_HANDLE_SIGNALS void __kmp_enable(int new_state) { -#if KMP_CANCEL_THREADS +#ifdef KMP_CANCEL_THREADS int status, old_state; status = pthread_setcancelstate(new_state, &old_state); KMP_CHECK_SYSFAIL("pthread_setcancelstate", status); @@ -1283,7 +1283,7 @@ void __kmp_enable(int new_state) { } void __kmp_disable(int *old_state) { -#if KMP_CANCEL_THREADS +#ifdef KMP_CANCEL_THREADS int status; status = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, old_state); KMP_CHECK_SYSFAIL("pthread_setcancelstate", status); @@ -2736,6 +2736,145 @@ int __kmp_get_load_balance(int max) { #endif // USE_LOAD_BALANCE +#if !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_MIC || KMP_ARCH_AARCH64 || \ + KMP_ARCH_PPC64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \ + KMP_ARCH_ARM || KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_PPC_XCOFF || \ + KMP_ARCH_AARCH64_32) + +// Because WebAssembly will use `call_indirect` to invoke the microtask and +// WebAssembly indirect calls check that the called signature is a precise +// match, we need to cast each microtask function pointer back from `void *` to +// its original type. +typedef void (*microtask_t0)(int *, int *); +typedef void (*microtask_t1)(int *, int *, void *); +typedef void (*microtask_t2)(int *, int *, void *, void *); +typedef void (*microtask_t3)(int *, int *, void *, void *, void *); +typedef void (*microtask_t4)(int *, int *, void *, void *, void *, void *); +typedef void (*microtask_t5)(int *, int *, void *, void *, void *, void *, + void *); +typedef void (*microtask_t6)(int *, int *, void *, void *, void *, void *, + void *, void *); +typedef void (*microtask_t7)(int *, int *, void *, void *, void *, void *, + void *, void *, void *); +typedef void (*microtask_t8)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *); +typedef void (*microtask_t9)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *); +typedef void (*microtask_t10)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *, void *); +typedef void (*microtask_t11)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *, void *, + void *); +typedef void (*microtask_t12)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *, void *, + void *, void *); +typedef void (*microtask_t13)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *, void *, + void *, void *, void *); +typedef void (*microtask_t14)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *, void *, + void *, void *, void *, void *); +typedef void (*microtask_t15)(int *, int *, void *, void *, void *, void *, + void *, void *, void *, void *, void *, void *, + void *, void *, void *, void *, void *); + +// we really only need the case with 1 argument, because CLANG always build +// a struct of pointers to shared variables referenced in the outlined function +int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int tid, int argc, + void *p_argv[] +#if OMPT_SUPPORT + , + void **exit_frame_ptr +#endif +) { +#if OMPT_SUPPORT + *exit_frame_ptr = OMPT_GET_FRAME_ADDRESS(0); +#endif + + switch (argc) { + default: + fprintf(stderr, "Too many args to microtask: %d!\n", argc); + fflush(stderr); + exit(-1); + case 0: + (*(microtask_t0)pkfn)(>id, &tid); + break; + case 1: + (*(microtask_t1)pkfn)(>id, &tid, p_argv[0]); + break; + case 2: + (*(microtask_t2)pkfn)(>id, &tid, p_argv[0], p_argv[1]); + break; + case 3: + (*(microtask_t3)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2]); + break; + case 4: + (*(microtask_t4)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3]); + break; + case 5: + (*(microtask_t5)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4]); + break; + case 6: + (*(microtask_t6)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5]); + break; + case 7: + (*(microtask_t7)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6]); + break; + case 8: + (*(microtask_t8)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7]); + break; + case 9: + (*(microtask_t9)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], p_argv[7], + p_argv[8]); + break; + case 10: + (*(microtask_t10)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7], p_argv[8], p_argv[9]); + break; + case 11: + (*(microtask_t11)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7], p_argv[8], p_argv[9], p_argv[10]); + break; + case 12: + (*(microtask_t12)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7], p_argv[8], p_argv[9], p_argv[10], + p_argv[11]); + break; + case 13: + (*(microtask_t13)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7], p_argv[8], p_argv[9], p_argv[10], + p_argv[11], p_argv[12]); + break; + case 14: + (*(microtask_t14)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7], p_argv[8], p_argv[9], p_argv[10], + p_argv[11], p_argv[12], p_argv[13]); + break; + case 15: + (*(microtask_t15)pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], + p_argv[3], p_argv[4], p_argv[5], p_argv[6], + p_argv[7], p_argv[8], p_argv[9], p_argv[10], + p_argv[11], p_argv[12], p_argv[13], p_argv[14]); + break; + } + + return 1; +} + +#endif + #if KMP_OS_LINUX // Functions for hidden helper task namespace { diff --git a/system/lib/openmp/src/z_Windows_NT-586_util.cpp b/system/lib/openmp/src/z_Windows_NT-586_util.cpp index 4ed309365b566..37759feafd453 100644 --- a/system/lib/openmp/src/z_Windows_NT-586_util.cpp +++ b/system/lib/openmp/src/z_Windows_NT-586_util.cpp @@ -12,8 +12,7 @@ #include "kmp.h" -#if (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM || \ - KMP_ARCH_ARM64EC) +#if (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM) /* Only 32-bit "add-exchange" instruction on IA-32 architecture causes us to use compare_and_store for these routines */ @@ -190,5 +189,4 @@ int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int tid, int argc, } #endif -#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM \ - || KMP_ARCH_ARM64EC */ +#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM */ diff --git a/system/lib/update_openmp.py b/system/lib/update_openmp.py index 5593ffe9f55e6..7c47133d5d305 100755 --- a/system/lib/update_openmp.py +++ b/system/lib/update_openmp.py @@ -15,6 +15,7 @@ emscripten_root, parse_args, script_dir, + update_readme, ) # system/lib/openmp (to be updated) @@ -92,6 +93,8 @@ def main(): for file in built_files: shutil.copy2(os.path.join(upstream_build_src, file), local_prebuilt) + update_readme(local_root, llvm_dir) + if __name__ == '__main__': main() diff --git a/tools/system_libs.py b/tools/system_libs.py index 90f0e965cc6f9..f64223c429a53 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -2341,7 +2341,7 @@ class libopenmp(Library): 'kmp_barrier.cpp', 'kmp_wait_release.cpp', 'kmp_affinity.cpp', 'kmp_dispatch.cpp', 'kmp_lock.cpp', 'kmp_sched.cpp', 'kmp_collapse.cpp', 'z_Linux_util.cpp', 'kmp_gsupport.cpp', 'kmp_taskdeps.cpp', 'kmp_cancel.cpp', 'kmp_ftn_cdecl.cpp', - 'kmp_ftn_extra.cpp', 'kmp_version.cpp', 'z_Linux_asm.S', 'kmp_invoke_microtask.cpp', + 'kmp_ftn_extra.cpp', 'kmp_version.cpp', 'z_Linux_asm.S', ]