Skip to content

Commit

Permalink
[OpenMP] Remove OMP spec versioning
Browse files Browse the repository at this point in the history
Remove all older OMP spec versioning from the runtime and build system.

Patch by Terry Wilmarth

Differential Revision: https://reviews.llvm.org/D64534

llvm-svn: 365963
  • Loading branch information
jpeyton52 committed Jul 12, 2019
1 parent 96f6fa8 commit a4db82a
Show file tree
Hide file tree
Showing 63 changed files with 170 additions and 7,281 deletions.
8 changes: 2 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ Options for ``libomp``
Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) to
build for. This value is ignored if **LIBOMP_ARCH** does not equal ``mic``.

**LIBOMP_OMP_VERSION** = ``50|45|40|30``
OpenMP version to build for. Older versions will disable certain
functionality and entry points.

**LIBOMP_LIB_TYPE** = ``normal|profile|stubs``
Library type can be ``normal``, ``profile``, or ``stubs``.

Expand Down Expand Up @@ -192,8 +188,8 @@ Optional Features
multi-node systems where a small ``CACHE_LINE`` setting leads to false sharing.

**LIBOMP_OMPT_SUPPORT** = ``ON|OFF``
Include support for the OpenMP Tools Interface (OMPT).
This option is supported and ``ON`` by default for x86, x86_64, AArch64, and
Include support for the OpenMP Tools Interface (OMPT).
This option is supported and ``ON`` by default for x86, x86_64, AArch64, and
PPC64 on Linux* and macOS*.
This option is ``OFF`` if this feature is not supported for the platform.

Expand Down
23 changes: 3 additions & 20 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,8 @@ libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc64 ppc64le aarch64 m
set(LIBOMP_LIB_TYPE normal CACHE STRING
"Performance,Profiling,Stubs library (normal/profile/stubs)")
libomp_check_variable(LIBOMP_LIB_TYPE normal profile stubs)
set(LIBOMP_OMP_VERSION 50 CACHE STRING
"The OpenMP version (50/45/40/30)")
libomp_check_variable(LIBOMP_OMP_VERSION 50 45 40 30)
# Set the OpenMP Year and Month assiociated with version
if(${LIBOMP_OMP_VERSION} GREATER 50 OR ${LIBOMP_OMP_VERSION} EQUAL 50)
set(LIBOMP_OMP_YEAR_MONTH 201611)
elseif(${LIBOMP_OMP_VERSION} GREATER 45 OR ${LIBOMP_OMP_VERSION} EQUAL 45)
set(LIBOMP_OMP_YEAR_MONTH 201511)
elseif(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
set(LIBOMP_OMP_YEAR_MONTH 201307)
elseif(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30)
set(LIBOMP_OMP_YEAR_MONTH 201107)
else()
set(LIBOMP_OMP_YEAR_MONTH 200505)
endif()
set(LIBOMP_OMP_YEAR_MONTH 201611)
set(LIBOMP_MIC_ARCH knc CACHE STRING
"Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) (knf/knc). Ignored if not Intel(R) MIC Architecture build.")
if("${LIBOMP_ARCH}" STREQUAL "mic")
Expand Down Expand Up @@ -213,7 +200,7 @@ endif()
set(LIBOMP_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBOMP_SRC_DIR ${LIBOMP_BASE_DIR}/src)
set(LIBOMP_TOOLS_DIR ${LIBOMP_BASE_DIR}/tools)
set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include/${LIBOMP_OMP_VERSION})
set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include)
set(LIBOMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

# Enabling Fortran if it is needed
Expand Down Expand Up @@ -301,7 +288,7 @@ endif()
# OMPT-support defaults to ON for OpenMP 5.0+ and if the requirements in
# cmake/config-ix.cmake are fulfilled.
set(OMPT_DEFAULT FALSE)
if ((${LIBOMP_OMP_VERSION} GREATER 49) AND (LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
if ((LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
set(OMPT_DEFAULT TRUE)
endif()
set(LIBOMP_OMPT_SUPPORT ${OMPT_DEFAULT} CACHE BOOL
Expand All @@ -314,9 +301,6 @@ set(LIBOMP_OMPT_OPTIONAL TRUE CACHE BOOL
if(LIBOMP_OMPT_SUPPORT AND (NOT LIBOMP_HAVE_OMPT_SUPPORT))
libomp_error_say("OpenMP Tools Interface requested but not available in this implementation")
endif()
if(LIBOMP_OMPT_SUPPORT AND (${LIBOMP_OMP_VERSION} LESS 50))
libomp_error_say("OpenMP Tools Interface only available with OpenMP 5.0, LIBOMP_OMP_VERSION is ${LIBOMP_OMP_VERSION}")
endif()

# TSAN-support
set(LIBOMP_TSAN_SUPPORT FALSE CACHE BOOL
Expand Down Expand Up @@ -368,7 +352,6 @@ if(${OPENMP_STANDALONE_BUILD})
libomp_say("Intel(R) MIC Architecture -- ${LIBOMP_MIC_ARCH}")
endif()
libomp_say("Build Type -- ${CMAKE_BUILD_TYPE}")
libomp_say("OpenMP Version -- ${LIBOMP_OMP_VERSION}")
libomp_say("Library Kind -- ${LIBOMP_LIBRARY_KIND}")
libomp_say("Library Type -- ${LIBOMP_LIB_TYPE}")
libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES}")
Expand Down
1 change: 0 additions & 1 deletion runtime/cmake/LibompDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ function(libomp_get_definitions_flags cppflags)
# CMake doesn't include CPPFLAGS from environment, but we will.
set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE)
endfunction()

10 changes: 3 additions & 7 deletions runtime/cmake/LibompExports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@

# Create the suffix for the export directory
# - Only add to suffix when not a default value
# - Example suffix: .deb.30.s1
# final export directory: exports/lin_32e.deb.30.s1/lib
# - These suffixes imply the build is a Debug, OpenMP 3.0, Stats-Gathering version of the library
# - Example suffix: .deb.s1
# final export directory: exports/lin_32e.deb.s1/lib
# - These suffixes imply the build is a Debug, Stats-Gathering version of the library
set(libomp_suffix)
libomp_append(libomp_suffix .deb DEBUG_BUILD)
libomp_append(libomp_suffix .dia RELWITHDEBINFO_BUILD)
libomp_append(libomp_suffix .min MINSIZEREL_BUILD)
if(NOT "${LIBOMP_OMP_VERSION}" STREQUAL "45")
libomp_append(libomp_suffix .${LIBOMP_OMP_VERSION})
endif()
libomp_append(libomp_suffix .s1 LIBOMP_STATS)
libomp_append(libomp_suffix .ompt LIBOMP_OMPT_SUPPORT)
if(${LIBOMP_OMPT_SUPPORT})
Expand Down Expand Up @@ -95,4 +92,3 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR}
)
endif()

12 changes: 0 additions & 12 deletions runtime/cmake/LibompHandleFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,6 @@ function(libomp_get_gdflags gdflags)
libomp_append(gdflags_local "-D stub" STUBS_LIBRARY)
libomp_append(gdflags_local "-D HAVE_QUAD" LIBOMP_USE_QUAD_PRECISION)
libomp_append(gdflags_local "-D USE_DEBUGGER" LIBOMP_USE_DEBUGGER)
if(${LIBOMP_OMP_VERSION} GREATER 50 OR ${LIBOMP_OMP_VERSION} EQUAL 50)
libomp_append(gdflags_local "-D OMP_50")
endif()
if(${LIBOMP_OMP_VERSION} GREATER 45 OR ${LIBOMP_OMP_VERSION} EQUAL 45)
libomp_append(gdflags_local "-D OMP_45")
endif()
if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
libomp_append(gdflags_local "-D OMP_40")
endif()
if(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30)
libomp_append(gdflags_local "-D OMP_30")
endif()
if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD})
libomp_append(gdflags_local "-D KMP_DEBUG")
endif()
Expand Down
6 changes: 2 additions & 4 deletions runtime/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ else()
libomp_append(LIBOMP_CXXFILES kmp_debugger.cpp LIBOMP_USE_DEBUGGER)
libomp_append(LIBOMP_CXXFILES kmp_stats.cpp LIBOMP_STATS)
libomp_append(LIBOMP_CXXFILES kmp_stats_timing.cpp LIBOMP_STATS)
if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
libomp_append(LIBOMP_CXXFILES kmp_taskdeps.cpp)
libomp_append(LIBOMP_CXXFILES kmp_cancel.cpp)
endif()
libomp_append(LIBOMP_CXXFILES kmp_taskdeps.cpp)
libomp_append(LIBOMP_CXXFILES kmp_cancel.cpp)
endif()
# Files common to stubs and normal library
libomp_append(LIBOMP_CXXFILES kmp_ftn_cdecl.cpp)
Expand Down
41 changes: 1 addition & 40 deletions runtime/src/dllexports
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,12 @@
__kmpc_reduce 189
__kmpc_end_reduce 190

# OpenMP 3.0

%ifdef OMP_30
__kmpc_omp_task_alloc 191
__kmpc_omp_task 192
__kmpc_omp_taskwait 193
__kmpc_omp_task_begin_if0 196
__kmpc_omp_task_complete_if0 197
__kmpc_omp_task_parts 198
%endif # OMP_30

# __omp_collector_api 199

Expand Down Expand Up @@ -320,9 +316,7 @@ kmpc_set_stacksize_s 222
# kmpc_set_stats 217
kmpc_set_defaults 224

# OMP 3.0 entry points for unsigned loop iteration variables
%ifndef stub
%ifdef OMP_30
__kmpc_for_static_init_8u 225
__kmpc_dispatch_init_8u 226
__kmpc_dispatch_next_8u 227
Expand All @@ -331,25 +325,19 @@ kmpc_set_defaults 224
__kmpc_dispatch_init_4u 230
__kmpc_dispatch_next_4u 231
__kmpc_dispatch_fini_4u 232
%endif # OMP_30
%endif

%ifndef stub
__kmpc_get_taskid 233
__kmpc_get_parent_taskid 234
%endif

# OpenMP 3.1 entry points
%ifndef stub
%ifdef OMP_30
__kmpc_omp_taskyield 235
%endif # OMP_30
# __kmpc_place_threads 236
%endif

# OpenMP 4.0 entry points
%ifndef stub
%ifdef OMP_40
__kmpc_push_proc_bind 237
__kmpc_taskgroup 238
__kmpc_end_taskgroup 239
Expand All @@ -372,12 +360,9 @@ kmpc_set_defaults 224
__kmpc_team_static_init_4u 256
__kmpc_team_static_init_8 257
__kmpc_team_static_init_8u 258
%endif # OMP_40
%endif

# OpenMP 4.5 entry points
%ifndef stub
%ifdef OMP_45
__kmpc_proxy_task_completed 259
__kmpc_proxy_task_completed_ooo 260
__kmpc_doacross_init 261
Expand All @@ -386,17 +371,14 @@ kmpc_set_defaults 224
__kmpc_doacross_fini 264
__kmpc_taskloop 266
__kmpc_critical_with_hint 270
%endif
%endif
kmpc_aligned_malloc 265
kmpc_set_disp_num_buffers 267

# OpenMP 5.0 entry points
%ifndef stub
%ifdef OMP_50
__kmpc_task_reduction_init 268
__kmpc_task_reduction_get_th_data 269
# USED FOR 4.5 __kmpc_critical_with_hint 270
# USED ABOVE __kmpc_critical_with_hint 270
__kmpc_get_target_offload 271
__kmpc_omp_reg_task_with_affinity 272
__kmpc_pause_resource 273
Expand All @@ -405,7 +387,6 @@ kmpc_set_disp_num_buffers 267
__kmpc_task_allow_completion_event 276
__kmpc_taskred_init 277
__kmpc_taskred_modifier_init 278
%endif
%endif

# User API entry points that have both lower- and upper- case versions for Fortran.
Expand Down Expand Up @@ -463,7 +444,6 @@ kmp_aligned_malloc 747
kmp_set_warnings_on 779
kmp_set_warnings_off 780

%ifdef OMP_30
omp_get_active_level 789
omp_get_level 790
omp_get_ancestor_thread_num 791
Expand All @@ -488,17 +468,9 @@ kmp_set_warnings_off 780
kmpc_unset_affinity_mask_proc 858
kmp_get_affinity_mask_proc 859
kmpc_get_affinity_mask_proc 860
%endif # OMP_30

# OpenMP 3.1

%ifdef OMP_30
omp_in_final 861
%endif # OMP_30

# OpenMP 40

%ifdef OMP_40
omp_get_proc_bind 862
#omp_set_proc_bind 863
#omp_curr_proc_bind 864
Expand All @@ -510,11 +482,7 @@ kmp_set_warnings_off 780
omp_set_default_device 879
omp_get_default_device 880
omp_get_num_devices 881
%endif # OMP_40

# OpenMP 45

%ifdef OMP_45
omp_init_lock_with_hint 870
omp_init_nest_lock_with_hint 871
omp_get_max_task_priority 872
Expand All @@ -534,11 +502,9 @@ kmp_set_warnings_off 780
omp_target_associate_ptr 888
omp_target_disassociate_ptr 889
%endif
%endif # OMP_45

kmp_set_disp_num_buffers 890

%ifdef OMP_50
omp_control_tool 891
omp_set_default_allocator 892
omp_get_default_allocator 893
Expand Down Expand Up @@ -583,7 +549,6 @@ kmp_set_disp_num_buffers 890
omp_const_mem_space DATA
omp_high_bw_mem_space DATA
omp_low_lat_mem_space DATA
%endif # OMP_50

%ifndef stub
# Ordinals between 900 and 999 are reserved
Expand Down Expand Up @@ -1033,8 +998,6 @@ kmp_set_disp_num_buffers 890
__kmpc_atomic_float10_div_cpt_fp
%endif

%ifdef OMP_40

# ATOMIC extensions for OpenMP 4.0 spec (x86 and x64 only)

__kmpc_atomic_fixed1_swp 2412
Expand Down Expand Up @@ -1209,8 +1172,6 @@ kmp_set_disp_num_buffers 890
__kmpc_atomic_float10_sub_cpt_rev_fp
__kmpc_atomic_float10_div_cpt_rev_fp
%endif
%endif # OMP_40


%endif # arch_64

Expand Down
Loading

0 comments on commit a4db82a

Please sign in to comment.