I apologise in advance for the size of this check-in. At Intel we do
understand that this is not friendly, and are working to change our
internal code-development to make it easier to make development
features available more frequently and in finer (more functional)
chunks. Unfortunately we haven't got that in place yet, and unpicking
this into multiple separate check-ins would be non-trivial, so please
bear with me on this one. We should be better in the future.
Apologies over, what do we have here?
GGC 4.9 compatibility
--------------------
* We have implemented the new entrypoints used by code compiled by GCC
4.9 to implement the same functionality in gcc 4.8. Therefore code
compiled with gcc 4.9 that used to work will continue to do so.
However, there are some other new entrypoints (associated with task
cancellation) which are not implemented. Therefore user code compiled
by gcc 4.9 that uses these new features will not link against the LLVM
runtime. (It remains unclear how to handle those entrypoints, since
the GCC interface has potentially unpleasant performance implications
for join barriers even when cancellation is not used)
--- new parallel entry points ---
new entry points that aren't OpenMP 4.0 related
These are implemented fully :-
GOMP_parallel_loop_dynamic()
GOMP_parallel_loop_guided()
GOMP_parallel_loop_runtime()
GOMP_parallel_loop_static()
GOMP_parallel_sections()
GOMP_parallel()
--- cancellation entry points ---
Currently, these only give a runtime error if OMP_CANCELLATION is true
because our plain barriers don't check for cancellation while waiting
GOMP_barrier_cancel()
GOMP_cancel()
GOMP_cancellation_point()
GOMP_loop_end_cancel()
GOMP_sections_end_cancel()
--- taskgroup entry points ---
These are implemented fully.
GOMP_taskgroup_start()
GOMP_taskgroup_end()
--- target entry points ---
These are empty (as they are in libgomp)
GOMP_target()
GOMP_target_data()
GOMP_target_end_data()
GOMP_target_update()
GOMP_teams()
Improvements in Barriers and Fork/Join
--------------------------------------
* Barrier and fork/join code is now in its own file (which makes it
easier to understand and modify).
* Wait/release code is now templated and in its own file; suspend/resume code is also templated
* There's a new, hierarchical, barrier, which exploits the
cache-hierarchy of the Intel(r) Xeon Phi(tm) coprocessor to improve
fork/join and barrier performance.
***BEWARE*** the new source files have *not* been added to the legacy
Cmake build system. If you want to use that fixes wil be required.
Statistics Collection Code
--------------------------
* New code has been added to collect application statistics (if this
is enabled at library compile time; by default it is not). The
statistics code itself is generally useful, the lightweight timing
code uses the X86 rdtsc instruction, so will require changes for other
architectures.
The intent of this code is not for users to tune their codes but
rather
1) For timing code-paths inside the runtime
2) For gathering general properties of OpenMP codes to focus attention
on which OpenMP features are most used.
Nested Hot Teams
----------------
* The runtime now maintains more state to reduce the overhead of
creating and destroying inner parallel teams. This improves the
performance of code that repeatedly uses nested parallelism with the
same resource allocation. Set the new KMP_HOT_TEAMS_MAX_LEVEL
envirable to a depth to enable this (and, of course, OMP_NESTED=true
to enable nested parallelism at all).
Improved Intel(r) VTune(Tm) Amplifier support
---------------------------------------------
* The runtime provides additional information to Vtune via the
itt_notify interface to allow it to display better OpenMP specific
analyses of load-imbalance.
Support for OpenMP Composite Statements
---------------------------------------
* Implement new entrypoints required by some of the OpenMP 4.1
composite statements.
Improved ifdefs
---------------
* More separation of concepts ("Does this platform do X?") from
platforms ("Are we compiling for platform Y?"), which should simplify
future porting.
ScaleMP* contribution
---------------------
Stack padding to improve the performance in their environment where
cross-node coherency is managed at the page level.
Redesign of wait and release code
---------------------------------
The code is simplified and performance improved.
Bug Fixes
---------
*Fixes for Windows multiple processor groups.
*Fix Fortran module build on Linux: offload attribute added.
*Fix entry names for distribute-parallel-loop construct to be consistent with the compiler codegen.
*Fix an inconsistent error message for KMP_PLACE_THREADS environment variable.
llvm-svn: 219214
2014-10-08 00:25:50 +08:00
|
|
|
#
|
|
|
|
#//===----------------------------------------------------------------------===//
|
|
|
|
#//
|
|
|
|
#// The LLVM Compiler Infrastructure
|
|
|
|
#//
|
|
|
|
#// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
#// Source Licenses. See LICENSE.txt for details.
|
|
|
|
#//
|
|
|
|
#//===----------------------------------------------------------------------===//
|
|
|
|
#
|
|
|
|
|
2014-08-05 17:32:28 +08:00
|
|
|
######################################################
|
|
|
|
# MICRO TESTS
|
|
|
|
# The following micro-tests are small tests to perform on
|
2015-06-12 01:23:57 +08:00
|
|
|
# the library just created in ${CMAKE_CURRENT_BINARY_DIR}/, there are currently
|
2014-08-05 17:32:28 +08:00
|
|
|
# five micro-tests:
|
|
|
|
# (1) test-touch
|
2015-06-01 11:05:13 +08:00
|
|
|
# - Compile and run a small program using newly created libomp library
|
2014-08-05 17:32:28 +08:00
|
|
|
# - Fails if test-touch.c does not compile or if test-touch.c does not run after compilation
|
|
|
|
# - Program dependencies: gcc or g++, grep, bourne shell
|
2015-05-23 06:35:51 +08:00
|
|
|
# - Available for all Linux,Mac,Windows builds. Not available on Intel(R) MIC Architecture builds.
|
2014-08-05 17:32:28 +08:00
|
|
|
# (2) test-relo
|
|
|
|
# - Tests dynamic libraries for position-dependent code (can not have any position dependent code)
|
2015-06-01 11:05:13 +08:00
|
|
|
# - Fails if TEXTREL is in output of readelf -d libomp.so command
|
2014-08-05 17:32:28 +08:00
|
|
|
# - Program dependencies: readelf, grep, bourne shell
|
|
|
|
# - Available for Linux, Intel(R) MIC Architecture dynamic library builds. Not available otherwise.
|
|
|
|
# (3) test-execstack
|
|
|
|
# - Tests if stack is executable
|
|
|
|
# - Fails if stack is executable. Should only be readable and writable. Not exectuable.
|
|
|
|
# - Program dependencies: perl, readelf
|
|
|
|
# - Available for Linux dynamic library builds. Not available otherwise.
|
|
|
|
# (4) test-instr (Intel(R) MIC Architecutre only)
|
|
|
|
# - Tests Intel(R) MIC Architecture libraries for valid instruction set
|
|
|
|
# - Fails if finds invalid instruction for Intel(R) MIC Architecture (wasn't compiled with correct flags)
|
|
|
|
# - Program dependencies: perl, objdump
|
|
|
|
# - Available for Intel(R) MIC Architecture builds. Not available otherwise.
|
|
|
|
# (5) test-deps
|
2015-06-01 11:05:13 +08:00
|
|
|
# - Tests newly created libomp for library dependencies
|
2014-08-05 17:32:28 +08:00
|
|
|
# - Fails if sees a dependence not listed in td_exp variable below
|
|
|
|
# - Program dependencies: perl, (linux)readelf, (mac)otool[64], (windows)link.exe
|
|
|
|
# - Available for Linux,Mac,Windows, Intel(R) MIC Architecture dynamic builds and Windows static builds. Not available otherwise.
|
|
|
|
#
|
|
|
|
# All tests can be turned off by including -Dtests=off when calling cmake
|
|
|
|
# An individual test can be turned off by issuing something like -Dtest_touch=off when calling cmake
|
|
|
|
|
|
|
|
# test-touch
|
2015-05-06 04:02:52 +08:00
|
|
|
if(${WINDOWS})
|
|
|
|
set(do_test_touch_mt TRUE)
|
|
|
|
if(${do_test_touch_mt})
|
|
|
|
set(test_touch_items ${test_touch_items} test-touch-md test-touch-mt)
|
2014-08-05 17:32:28 +08:00
|
|
|
else()
|
2015-05-06 04:02:52 +08:00
|
|
|
set(test_touch_items ${test_touch_items} test-touch-md)
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
2015-05-06 04:02:52 +08:00
|
|
|
else()
|
|
|
|
set(test_touch_items ${test_touch_items} test-touch-rt)
|
|
|
|
endif()
|
|
|
|
set(regular_test_touch_items "${test_touch_items}")
|
|
|
|
add_suffix("/.success" regular_test_touch_items)
|
|
|
|
# test-touch : ${test_touch_items}/.success
|
|
|
|
set(ldeps "${regular_test_touch_items}")
|
2015-06-01 11:05:13 +08:00
|
|
|
add_custom_target(libomp-test-touch DEPENDS ${ldeps})
|
2014-08-05 17:32:28 +08:00
|
|
|
|
2015-05-06 04:02:52 +08:00
|
|
|
if(${WINDOWS})
|
|
|
|
# pick test-touch compiler
|
|
|
|
set(tt-c cl)
|
|
|
|
# test-touch compilation flags
|
|
|
|
list(APPEND tt-c-flags -nologo)
|
|
|
|
if(${RELEASE_BUILD} OR ${RELWITHDEBINFO_BUILD})
|
|
|
|
list(APPEND tt-c-flags-mt -MT)
|
|
|
|
list(APPEND tt-c-flags-md -MD)
|
|
|
|
else()
|
|
|
|
list(APPEND tt-c-flags-mt -MTd)
|
|
|
|
list(APPEND tt-c-flags-md -MDd)
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
2015-06-12 01:23:57 +08:00
|
|
|
list(APPEND tt-libs ${CMAKE_CURRENT_BINARY_DIR}/${imp_file})
|
2015-05-06 04:02:52 +08:00
|
|
|
list(APPEND tt-ld-flags -link -nodefaultlib:oldnames)
|
|
|
|
if(${IA32})
|
|
|
|
list(APPEND tt-ld-flags -safeseh)
|
|
|
|
endif()
|
|
|
|
list(APPEND tt-ld-flags-v -verbose)
|
|
|
|
else() # (Unix based systems, Intel(R) MIC Architecture, and Mac)
|
|
|
|
# pick test-touch compiler
|
|
|
|
if(${STD_CPP_LIB})
|
|
|
|
set(tt-c ${CMAKE_CXX_COMPILER})
|
2014-08-05 17:32:28 +08:00
|
|
|
else()
|
2015-05-06 04:02:52 +08:00
|
|
|
set(tt-c ${CMAKE_C_COMPILER})
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
2015-05-06 04:02:52 +08:00
|
|
|
# test-touch compilation flags
|
|
|
|
if(${LINUX})
|
|
|
|
list(APPEND tt-c-flags -pthread)
|
|
|
|
endif()
|
|
|
|
if(${IA32})
|
|
|
|
list(APPEND tt-c-flags -m32)
|
|
|
|
elseif(${INTEL64})
|
|
|
|
list(APPEND tt-c-flags -m64)
|
|
|
|
endif()
|
2015-06-12 01:23:57 +08:00
|
|
|
list(APPEND tt-libs ${CMAKE_CURRENT_BINARY_DIR}/${lib_file})
|
2015-05-06 04:02:52 +08:00
|
|
|
if(${MAC})
|
|
|
|
list(APPEND tt-ld-flags-v -Wl,-t)
|
|
|
|
set(tt-env "DYLD_LIBRARY_PATH=.:$ENV{DYLD_LIBRARY_PATH}")
|
2014-08-05 17:32:28 +08:00
|
|
|
else()
|
2015-05-06 04:02:52 +08:00
|
|
|
list(APPEND tt-ld-flags-v -Wl,--verbose)
|
2015-06-12 01:23:57 +08:00
|
|
|
set(tt-env LD_LIBRARY_PATH=".:${CMAKE_CURRENT_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2015-05-06 04:02:52 +08:00
|
|
|
list(APPEND tt-c-flags "${tt-c-flags-rt}")
|
|
|
|
list(APPEND tt-env "KMP_VERSION=1")
|
2014-08-05 17:32:28 +08:00
|
|
|
|
2015-05-06 04:02:52 +08:00
|
|
|
macro(test_touch_recipe test_touch_dir)
|
2015-06-12 01:23:57 +08:00
|
|
|
set(ldeps ${src_dir}/test-touch.c omp)
|
2015-05-06 04:02:52 +08:00
|
|
|
set(tt-exe-file ${test_touch_dir}/test-touch${exe})
|
|
|
|
if(${WINDOWS})
|
|
|
|
# ****** list(APPEND tt-c-flags -Fo$(dir $@)test-touch${obj} -Fe$(dir $@)test-touch${exe}) *******
|
|
|
|
set(tt-c-flags-out -Fo${test_touch_dir}/test-touch${obj} -Fe${test_touch_dir}/test-touch${exe})
|
2015-06-12 01:23:57 +08:00
|
|
|
list(APPEND ldeps ${CMAKE_CURRENT_BINARY_DIR}/${imp_file})
|
2014-08-05 17:32:28 +08:00
|
|
|
else()
|
2015-05-06 04:02:52 +08:00
|
|
|
# ****** list(APPEND tt-c-flags -o $(dir $@)test-touch${exe}) ********
|
|
|
|
set(tt-c-flags-out -o ${test_touch_dir}/test-touch${exe})
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
|
|
|
add_custom_command(
|
2015-05-06 04:02:52 +08:00
|
|
|
OUTPUT ${test_touch_dir}/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${test_touch_dir}
|
2015-05-06 04:02:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove -f ${test_touch_dir}/*
|
|
|
|
COMMAND ${tt-c} ${tt-c-flags-out} ${tt-c-flags} ${src_dir}/test-touch.c ${tt-libs} ${tt-ld-flags}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove -f ${tt-exe-file}
|
|
|
|
COMMAND ${tt-c} ${tt-c-flags-out} ${tt-c-flags} ${src_dir}/test-touch.c ${tt-libs} ${tt-ld-flags} ${tt-ld-flags-v} > ${test_touch_dir}/build.log 2>&1
|
|
|
|
COMMAND ${tt-env} ${tt-exe-file}
|
|
|
|
#COMMAND grep -i -e \"[^_]libirc\" ${test_touch_dir}/build.log > ${test_touch_dir}/libirc.log \; [ $$? -eq 1 ]
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E touch ${test_touch_dir}/.success
|
|
|
|
DEPENDS ${ldeps}
|
2014-08-05 17:32:28 +08:00
|
|
|
)
|
2015-05-06 04:02:52 +08:00
|
|
|
endmacro()
|
|
|
|
if(${WINDOWS})
|
|
|
|
test_touch_recipe(test-touch-mt)
|
|
|
|
test_touch_recipe(test-touch-md)
|
|
|
|
else()
|
|
|
|
test_touch_recipe(test-touch-rt)
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
|
|
|
|
2015-05-06 04:02:52 +08:00
|
|
|
# test-relo
|
2015-06-01 11:05:13 +08:00
|
|
|
add_custom_target(libomp-test-relo DEPENDS test-relo/.success)
|
2015-05-06 04:02:52 +08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT test-relo/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-relo
|
|
|
|
COMMAND readelf -d ${CMAKE_CURRENT_BINARY_DIR}/${lib_file} > test-relo/readelf.log
|
2015-05-06 04:02:52 +08:00
|
|
|
COMMAND grep -e TEXTREL test-relo/readelf.log \; [ $$? -eq 1 ]
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E touch test-relo/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
DEPENDS omp
|
2015-05-06 04:02:52 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# test-execstack
|
2015-06-01 11:05:13 +08:00
|
|
|
add_custom_target(libomp-test-execstack DEPENDS test-execstack/.success)
|
2015-05-06 04:02:52 +08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT test-execstack/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-execstack
|
|
|
|
COMMAND ${PERL_EXECUTABLE} ${tools_dir}/check-execstack.pl ${oa_opts} ${CMAKE_CURRENT_BINARY_DIR}/${lib_file}
|
2015-05-06 04:02:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E touch test-execstack/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
DEPENDS omp
|
2015-05-06 04:02:52 +08:00
|
|
|
)
|
|
|
|
|
2014-08-05 17:32:28 +08:00
|
|
|
# test-instr
|
2015-06-01 11:05:13 +08:00
|
|
|
add_custom_target(libomp-test-instr DEPENDS test-instr/.success)
|
2015-05-06 04:02:52 +08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT test-instr/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-instr
|
|
|
|
COMMAND ${PERL_EXECUTABLE} ${tools_dir}/check-instruction-set.pl ${oa_opts} --show --mic-arch=${LIBOMP_MIC_ARCH} ${CMAKE_CURRENT_BINARY_DIR}/${lib_file}
|
2015-05-06 04:02:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E touch test-instr/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
DEPENDS omp ${tools_dir}/check-instruction-set.pl
|
2015-05-06 04:02:52 +08:00
|
|
|
)
|
2014-08-05 17:32:28 +08:00
|
|
|
|
|
|
|
# test-deps
|
2015-06-01 11:05:13 +08:00
|
|
|
add_custom_target(libomp-test-deps DEPENDS test-deps/.success)
|
2015-05-06 04:02:52 +08:00
|
|
|
set(td_exp)
|
|
|
|
if(${FREEBSD})
|
|
|
|
set(td_exp libc.so.7 libthr.so.3 libunwind.so.5)
|
|
|
|
elseif(${MAC})
|
|
|
|
set(td_exp /usr/lib/libSystem.B.dylib)
|
|
|
|
elseif(${WINDOWS})
|
|
|
|
set(td_exp kernel32.dll)
|
|
|
|
elseif(${LINUX})
|
|
|
|
if(${MIC})
|
|
|
|
set(td_exp libc.so.6,libpthread.so.0,libdl.so.2)
|
2014-08-05 17:32:28 +08:00
|
|
|
if(${STD_CPP_LIB})
|
|
|
|
set(td_exp ${td_exp},libstdc++.so.6)
|
|
|
|
endif()
|
2015-05-21 06:33:24 +08:00
|
|
|
if("${LIBOMP_MIC_ARCH}" STREQUAL "knf")
|
2015-05-06 04:02:52 +08:00
|
|
|
set(td_exp ${td_exp},ld-linux-l1om.so.2,libgcc_s.so.1)
|
2015-05-21 06:33:24 +08:00
|
|
|
elseif("${LIBOMP_MIC_ARCH}" STREQUAL "knc")
|
2015-05-06 04:02:52 +08:00
|
|
|
set(td_exp ${td_exp},ld-linux-k1om.so.2)
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
|
|
|
else()
|
2015-05-06 04:02:52 +08:00
|
|
|
set(td_exp libdl.so.2,libgcc_s.so.1)
|
|
|
|
if(${IA32})
|
|
|
|
set(td_exp ${td_exp},libc.so.6,ld-linux.so.2)
|
|
|
|
elseif(${INTEL64})
|
|
|
|
set(td_exp ${td_exp},libc.so.6,ld-linux-x86-64.so.2)
|
|
|
|
elseif(${ARM})
|
|
|
|
set(td_exp ${td_exp},libffi.so.6,libffi.so.5,libc.so.6,ld-linux-armhf.so.3)
|
|
|
|
elseif(${PPC64})
|
|
|
|
set(td_exp ${td_exp},libc.so.6,ld64.so.1)
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
2015-05-06 04:02:52 +08:00
|
|
|
if(${STD_CPP_LIB})
|
|
|
|
set(td_exp ${td_exp},libstdc++.so.6)
|
|
|
|
endif()
|
|
|
|
if(NOT ${STUBS_LIBRARY})
|
|
|
|
set(td_exp ${td_exp},libpthread.so.0)
|
|
|
|
endif()
|
|
|
|
endif()
|
2014-08-05 17:32:28 +08:00
|
|
|
endif()
|
2015-05-06 04:02:52 +08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT test-deps/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-deps
|
|
|
|
COMMAND ${PERL_EXECUTABLE} ${tools_dir}/check-depends.pl ${oa_opts} --expected="${td_exp}" ${CMAKE_CURRENT_BINARY_DIR}/${lib_file}
|
2015-05-06 04:02:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E touch test-deps/.success
|
2015-06-12 01:23:57 +08:00
|
|
|
DEPENDS omp ${tools_dir}/check-depends.pl
|
2015-05-06 04:02:52 +08:00
|
|
|
)
|
2014-08-05 17:32:28 +08:00
|
|
|
# END OF TESTS
|
|
|
|
######################################################
|