Skip to content

Commit 3fa624f

Browse files
Merge commit '50d0db9ec2ba2a8a44e2230cdc7922a0964c944c' into UpdateBOLT-50d0db
2 parents be724e2 + 50d0db9 commit 3fa624f

File tree

169 files changed

+6570
-2337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+6570
-2337
lines changed

.arcconfig

-4
This file was deleted.

CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ set(ENABLE_LIBOMPTARGET ON)
7373
# Currently libomptarget cannot be compiled on Windows or MacOS X.
7474
# Since the device plugins are only supported on Linux anyway,
7575
# there is no point in trying to compile libomptarget on other OSes.
76-
if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP11_FLAG)
76+
if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG)
7777
set(ENABLE_LIBOMPTARGET OFF)
7878
endif()
7979

@@ -83,8 +83,8 @@ if (OPENMP_ENABLE_LIBOMPTARGET)
8383
# Check that the library can actually be built.
8484
if (APPLE OR WIN32)
8585
message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!")
86-
elseif (NOT OPENMP_HAVE_STD_CPP11_FLAG)
87-
message(FATAL_ERROR "Host compiler must support C++11 to build libomptarget!")
86+
elseif (NOT OPENMP_HAVE_STD_CPP14_FLAG)
87+
message(FATAL_ERROR "Host compiler must support C++14 to build libomptarget!")
8888
endif()
8989

9090
add_subdirectory(libomptarget)
@@ -102,5 +102,5 @@ if (OPENMP_ENABLE_OMPT_TOOLS)
102102
add_subdirectory(tools)
103103
endif()
104104

105-
# Now that we have seen all testuites, create the check-openmp target.
105+
# Now that we have seen all testsuites, create the check-openmp target.
106106
construct_check_openmp_target()

README.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ How to Build the LLVM* OpenMP* Libraries
44
This repository requires `CMake <http://www.cmake.org/>`_ v2.8.0 or later. LLVM
55
and Clang need a more recent version which also applies for in-tree builds. For
66
more information than available in this document please see
7-
`LLVM's CMake documentation <http://llvm.org/docs/CMake.html>`_ and the
7+
`LLVM's CMake documentation <https://llvm.org/docs/CMake.html>`_ and the
88
`official documentation <https://cmake.org/cmake/help/v2.8.0/cmake.html>`_.
99

1010
.. contents::
@@ -130,6 +130,10 @@ Options for all Libraries
130130
Specify full path to ``FileCheck`` executable for running tests. The default
131131
is to search the ``PATH`` and the directory in **OPENMP_LLVM_TOOLS_DIR**.
132132

133+
**OPENMP_NOT_EXECUTABLE** = ``/path/to/not``
134+
Specify full path to ``not`` executable for running tests. The default
135+
is to search the ``PATH`` and the directory in **OPENMP_LLVM_TOOLS_DIR**.
136+
133137
Options for ``libomp``
134138
----------------------
135139

cmake/HandleOpenMPOptions.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ append_if(OPENMP_HAVE_WNO_EXTRA_FLAG "-Wno-extra" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
2929
append_if(OPENMP_HAVE_WNO_PEDANTIC_FLAG "-Wno-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
3030
append_if(OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG "-Wno-maybe-uninitialized" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
3131

32-
append_if(OPENMP_HAVE_STD_GNUPP11_FLAG "-std=gnu++11" CMAKE_CXX_FLAGS)
33-
if (NOT OPENMP_HAVE_STD_GNUPP11_FLAG)
34-
append_if(OPENMP_HAVE_STD_CPP11_FLAG "-std=c++11" CMAKE_CXX_FLAGS)
32+
append_if(OPENMP_HAVE_STD_GNUPP14_FLAG "-std=gnu++14" CMAKE_CXX_FLAGS)
33+
if (NOT OPENMP_HAVE_STD_GNUPP14_FLAG)
34+
append_if(OPENMP_HAVE_STD_CPP14_FLAG "-std=c++14" CMAKE_CXX_FLAGS)
3535
endif()

cmake/OpenMPTesting.cmake

+41-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Keep track if we have all dependencies.
2-
set(ENABLE_CHECK_TARGETS TRUE)
2+
set(ENABLE_CHECK_BOLT_TARGETS TRUE)
33

44
# Function to find required dependencies for testing.
55
function(find_standalone_test_dependencies)
@@ -8,7 +8,7 @@ function(find_standalone_test_dependencies)
88
if (NOT PYTHONINTERP_FOUND)
99
message(STATUS "Could not find Python.")
1010
message(WARNING "The check targets will not be available!")
11-
set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
11+
set(ENABLE_CHECK_BOLT_TARGETS FALSE PARENT_SCOPE)
1212
return()
1313
endif()
1414

@@ -20,7 +20,7 @@ function(find_standalone_test_dependencies)
2020
message(STATUS "Cannot find llvm-lit.")
2121
message(STATUS "Please put llvm-lit in your PATH, set OPENMP_LLVM_LIT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
2222
message(WARNING "The check targets will not be available!")
23-
set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
23+
set(ENABLE_CHECK_BOLT_TARGETS FALSE PARENT_SCOPE)
2424
return()
2525
endif()
2626

@@ -31,7 +31,18 @@ function(find_standalone_test_dependencies)
3131
message(STATUS "Cannot find FileCheck.")
3232
message(STATUS "Please put FileCheck in your PATH, set OPENMP_FILECHECK_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
3333
message(WARNING "The check targets will not be available!")
34-
set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
34+
set(ENABLE_CHECK_BOLT_TARGETS FALSE PARENT_SCOPE)
35+
return()
36+
endif()
37+
38+
find_program(OPENMP_NOT_EXECUTABLE
39+
NAMES not
40+
PATHS ${OPENMP_LLVM_TOOLS_DIR})
41+
if (NOT OPENMP_NOT_EXECUTABLE)
42+
message(STATUS "Cannot find 'not'.")
43+
message(STATUS "Please put 'not' in your PATH, set OPENMP_NOT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
44+
message(WARNING "The check targets will not be available!")
45+
set(ENABLE_CHECK_BOLT_TARGETS FALSE PARENT_SCOPE)
3546
return()
3647
endif()
3748
endfunction()
@@ -55,6 +66,7 @@ if (${OPENMP_STANDALONE_BUILD})
5566
separate_arguments(OPENMP_LIT_ARGS)
5667
else()
5768
set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
69+
set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
5870
endif()
5971

6072
# Macro to extract information about compiler from file. (no own scope)
@@ -81,7 +93,7 @@ function(set_test_compiler_information dir)
8193
"${OPENMP_TEST_C_COMPILER_VERSION}" STREQUAL "${OPENMP_TEST_CXX_COMPILER_VERSION}"))
8294
message(STATUS "Test compilers for C and C++ don't match.")
8395
message(WARNING "The check targets will not be available!")
84-
set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
96+
set(ENABLE_CHECK_BOLT_TARGETS FALSE PARENT_SCOPE)
8597
else()
8698
set(OPENMP_TEST_COMPILER_ID "${OPENMP_TEST_C_COMPILER_ID}" PARENT_SCOPE)
8799
set(OPENMP_TEST_COMPILER_VERSION "${OPENMP_TEST_C_COMPILER_VERSION}" PARENT_SCOPE)
@@ -112,7 +124,7 @@ if (${OPENMP_STANDALONE_BUILD})
112124
if (DETECT_COMPILER_RESULT)
113125
message(STATUS "Could not detect test compilers.")
114126
message(WARNING "The check targets will not be available!")
115-
set(ENABLE_CHECK_TARGETS FALSE)
127+
set(ENABLE_CHECK_BOLT_TARGETS FALSE)
116128
else()
117129
set_test_compiler_information(${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler)
118130
endif()
@@ -121,8 +133,8 @@ else()
121133
set(OPENMP_TEST_COMPILER_ID "Clang")
122134
# Cannot use CLANG_VERSION because we are not guaranteed that this is already set.
123135
set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}")
124-
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}")
125-
set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_MAJOR_VERSION}.${LLVM_MINOR_VERSION}")
136+
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_VERSION_MAJOR}")
137+
set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
126138
# Unfortunately the top-level cmake/config-ix.cmake file mangles CMake's
127139
# CMAKE_THREAD_LIBS_INIT variable from the FindThreads package, so work
128140
# around that, until it is fixed there.
@@ -156,16 +168,16 @@ set_test_compiler_features()
156168

157169
# Function to add a testsuite for an OpenMP runtime library.
158170
function(add_openmp_testsuite target comment)
159-
if (NOT ENABLE_CHECK_TARGETS)
171+
if (NOT ENABLE_CHECK_BOLT_TARGETS)
160172
add_custom_target(${target}
161173
COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, dependencies not found.")
162174
message(STATUS "${target} does nothing.")
163175
return()
164176
endif()
165177

166-
cmake_parse_arguments(ARG "" "" "DEPENDS;ARGS" ${ARGN})
167-
# EXCLUDE_FROM_ALL excludes the test ${target} out of check-openmp.
168-
if (NOT EXCLUDE_FROM_ALL)
178+
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "" "DEPENDS;ARGS" ${ARGN})
179+
# EXCLUDE_FROM_CHECK_ALL excludes the test ${target} out of check-openmp.
180+
if (NOT ARG_EXCLUDE_FROM_CHECK_ALL)
169181
# Register the testsuites and depends for the check-openmp rule.
170182
set_property(GLOBAL APPEND PROPERTY OPENMP_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS})
171183
set_property(GLOBAL APPEND PROPERTY OPENMP_LIT_DEPENDS ${ARG_DEPENDS})
@@ -180,12 +192,22 @@ function(add_openmp_testsuite target comment)
180192
${cmake_3_2_USES_TERMINAL}
181193
)
182194
else()
183-
add_lit_testsuite(${target}
184-
${comment}
185-
${ARG_UNPARSED_ARGUMENTS}
186-
DEPENDS clang clang-resource-headers FileCheck ${ARG_DEPENDS}
187-
ARGS ${ARG_ARGS}
188-
)
195+
if (ARG_EXCLUDE_FROM_CHECK_ALL)
196+
add_lit_testsuite(${target}
197+
${comment}
198+
${ARG_UNPARSED_ARGUMENTS}
199+
EXCLUDE_FROM_CHECK_ALL
200+
DEPENDS clang clang-resource-headers FileCheck ${ARG_DEPENDS}
201+
ARGS ${ARG_ARGS}
202+
)
203+
else()
204+
add_lit_testsuite(${target}
205+
${comment}
206+
${ARG_UNPARSED_ARGUMENTS}
207+
DEPENDS clang clang-resource-headers FileCheck ${ARG_DEPENDS}
208+
ARGS ${ARG_ARGS}
209+
)
210+
endif()
189211
endif()
190212
endfunction()
191213

@@ -194,6 +216,5 @@ function(construct_check_openmp_target)
194216
get_property(OPENMP_LIT_DEPENDS GLOBAL PROPERTY OPENMP_LIT_DEPENDS)
195217

196218
# We already added the testsuites themselves, no need to do that again.
197-
set(EXCLUDE_FROM_ALL True)
198-
add_openmp_testsuite(check-bolt-openmp "Running BOLT tests" ${OPENMP_LIT_TESTSUITES} DEPENDS ${OPENMP_LIT_DEPENDS})
219+
add_openmp_testsuite(check-bolt-openmp "Running BOLT tests" ${OPENMP_LIT_TESTSUITES} EXCLUDE_FROM_CHECK_ALL DEPENDS ${OPENMP_LIT_DEPENDS})
199220
endfunction()

cmake/config-ix.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ check_cxx_compiler_flag(-Wno-extra OPENMP_HAVE_WNO_EXTRA_FLAG)
1414
check_cxx_compiler_flag(-Wno-pedantic OPENMP_HAVE_WNO_PEDANTIC_FLAG)
1515
check_cxx_compiler_flag(-Wno-maybe-uninitialized OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG)
1616

17-
check_cxx_compiler_flag(-std=gnu++11 OPENMP_HAVE_STD_GNUPP11_FLAG)
18-
check_cxx_compiler_flag(-std=c++11 OPENMP_HAVE_STD_CPP11_FLAG)
17+
check_cxx_compiler_flag(-std=gnu++14 OPENMP_HAVE_STD_GNUPP14_FLAG)
18+
check_cxx_compiler_flag(-std=c++14 OPENMP_HAVE_STD_CPP14_FLAG)

docs/ReleaseNotes.rst

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
===========================
2+
openmp 11.0.0 Release Notes
3+
===========================
4+
5+
.. contents::
6+
:local:
7+
8+
.. warning::
9+
These are in-progress notes for the upcoming LLVM 11.0.0 release.
10+
Release notes for previous releases can be found on
11+
`the Download Page <https://releases.llvm.org/download.html>`_.
12+
13+
Introduction
14+
============
15+
16+
This document contains the release notes for the OpenMP runtime, release 11.0.0.
17+
Here we describe the status of openmp, including major improvements
18+
from the previous release. All openmp releases may be downloaded
19+
from the `LLVM releases web site <https://llvm.org/releases/>`_.
20+
21+
Non-comprehensive list of changes in this release
22+
=================================================
23+
24+
5.0 features
25+
------------
26+
27+
* ...
28+
29+
5.1 features
30+
------------
31+
32+
* ...
33+
34+
OMPT Improvements
35+
-----------------
36+
37+
* Added OMPT callbacks for doacross loops, detached tasks
38+
* Added handling for mutexinoutset dependencies
39+
40+
OMPT-based Tools
41+
----------------
42+
43+
* Added ompt-multiplex.h as a header-only OMPT-tool to support nesting of OMPT
44+
tools. (see openmp/tools/multiplex)
45+

libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake

+56
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# libffi : required to launch target kernels given function and argument
1616
# pointers.
1717
# CUDA : required to control offloading to NVIDIA GPUs.
18+
# VEOS : required to control offloading to NEC Aurora.
1819

1920
include (FindPackageHandleStandardArgs)
2021

@@ -162,6 +163,61 @@ find_package_handle_standard_args(
162163
mark_as_advanced(LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES)
163164

164165
################################################################################
166+
# Looking for VEO...
167+
################################################################################
168+
169+
find_path (
170+
LIBOMPTARGET_DEP_VEO_INCLUDE_DIR
171+
NAMES
172+
ve_offload.h
173+
PATHS
174+
/usr/include
175+
/usr/local/include
176+
/opt/local/include
177+
/sw/include
178+
/opt/nec/ve/veos/include
179+
ENV CPATH
180+
PATH_SUFFIXES
181+
libveo)
182+
183+
find_library (
184+
LIBOMPTARGET_DEP_VEO_LIBRARIES
185+
NAMES
186+
veo
187+
PATHS
188+
/usr/lib
189+
/usr/local/lib
190+
/opt/local/lib
191+
/sw/lib
192+
/opt/nec/ve/veos/lib64
193+
ENV LIBRARY_PATH
194+
ENV LD_LIBRARY_PATH)
195+
196+
find_library(
197+
LIBOMPTARGET_DEP_VEOSINFO_LIBRARIES
198+
NAMES
199+
veosinfo
200+
PATHS
201+
/usr/lib
202+
/usr/local/lib
203+
/opt/local/lib
204+
/sw/lib
205+
/opt/nec/ve/veos/lib64
206+
ENV LIBRARY_PATH
207+
ENV LD_LIBRARY_PATH)
208+
209+
set(LIBOMPTARGET_DEP_VEO_INCLUDE_DIRS ${LIBOMPTARGET_DEP_VEO_INCLUDE_DIR})
210+
find_package_handle_standard_args(
211+
LIBOMPTARGET_DEP_VEO
212+
DEFAULT_MSG
213+
LIBOMPTARGET_DEP_VEO_LIBRARIES
214+
LIBOMPTARGET_DEP_VEOSINFO_LIBRARIES
215+
LIBOMPTARGET_DEP_VEO_INCLUDE_DIRS)
216+
217+
mark_as_advanced(
218+
LIBOMPTARGET_DEP_VEO_FOUND
219+
LIBOMPTARGET_DEP_VEO_INCLUDE_DIRS)
220+
165221
# Looking for CUDA libdevice subdirectory
166222
#
167223
# Special case for Debian/Ubuntu to have nvidia-cuda-toolkit work

libomptarget/cmake/Modules/LibomptargetNVPTXBitcodeLibrary.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ endfunction()
7878

7979
# These flags are required to emit LLVM Bitcode. We check them together because
8080
# if any of them are not supported, there is no point in finding out which are.
81-
set(compiler_flags_required -emit-llvm -O1 --cuda-device-only -std=c++11 --cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
81+
set(compiler_flags_required -emit-llvm -O1 --cuda-device-only -std=c++14 --cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
8282
set(compiler_flags_required_src "extern \"C\" __device__ int thread() { return threadIdx.x; }")
8383
check_bitcode_compilation(LIBOMPTARGET_NVPTX_CUDA_COMPILER_SUPPORTS_FLAGS_REQUIRED "${compiler_flags_required_src}" ${compiler_flags_required})
8484

libomptarget/deviceRTLs/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
#
1111
##===----------------------------------------------------------------------===##
1212

13-
add_subdirectory(amdgcn)
1413
add_subdirectory(nvptx)

libomptarget/deviceRTLs/amdgcn/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ get_filename_component(devicertl_base_directory
5555
DIRECTORY)
5656

5757
set(cuda_sources
58+
${CMAKE_CURRENT_SOURCE_DIR}/src/amdgcn_smid.hip
59+
${CMAKE_CURRENT_SOURCE_DIR}/src/amdgcn_locks.hip
5860
${CMAKE_CURRENT_SOURCE_DIR}/src/target_impl.hip
5961
${devicertl_base_directory}/common/src/cancel.cu
6062
${devicertl_base_directory}/common/src/critical.cu
@@ -97,7 +99,7 @@ endif()
9799

98100
macro(add_cuda_bc_library)
99101
set(cu_cmd ${AOMP_BINDIR}/clang++
100-
-std=c++11
102+
-std=c++14
101103
-fcuda-rdc
102104
-fvisibility=default
103105
--cuda-device-only
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===-- amdgcn_locks.hip - AMDGCN OpenMP GPU lock implementation -- HIP -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// A 'thread' maps onto a lane of the wavefront. This means a per-thread lock
10+
// cannot be implemented - if one thread gets the lock, it can't continue on to
11+
// the next instruction in order to do anything as the other threads are waiting
12+
// to take the lock.
13+
// These functions will be implemented to provide the documented semantics for
14+
// a SIMD => wavefront mapping once that is implemented.
15+
//
16+
//===----------------------------------------------------------------------===//
17+
18+
#include "common/debug.h"
19+
20+
static DEVICE void warn() {
21+
PRINT0(LD_ALL, "Locks are not supported in this thread mapping model");
22+
}
23+
24+
DEVICE void __kmpc_impl_init_lock(omp_lock_t *) { warn(); }
25+
DEVICE void __kmpc_impl_destroy_lock(omp_lock_t *) { warn(); }
26+
DEVICE void __kmpc_impl_set_lock(omp_lock_t *) { warn(); }
27+
DEVICE void __kmpc_impl_unset_lock(omp_lock_t *) { warn(); }
28+
DEVICE int __kmpc_impl_test_lock(omp_lock_t *lock) { warn(); }

0 commit comments

Comments
 (0)