Skip to content

Commit 972f98e

Browse files
committed
Committing Parallel STL 20181204 open source release
1 parent f2d2990 commit 972f98e

File tree

88 files changed

+2330
-1805
lines changed

Some content is hidden

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

88 files changed

+2330
-1805
lines changed

CHANGES

+21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
------------------------------------------------------------------------
22
The list of most significant changes made over time in Parallel STL.
33

4+
Parallel STL 20181204 release
5+
PSTL_VERSION == 203
6+
7+
Features / APIs:
8+
9+
- More algorithms support parallel execution policies:
10+
set_union, set_intersection, set_difference, set_symmetric_difference.
11+
- Improved performance in reverse, reverse_copy algorithm with vector
12+
execution policies.
13+
- Added FindTBB CMake module - Preview Feature.
14+
15+
Bugs fixed:
16+
17+
- Fixed several algorithms which use scan and reduction patterns with
18+
a user defined binary operation with vector execution policies.
19+
20+
Examples:
21+
22+
- CMake support for gamma_correction sample was added.
23+
24+
------------------------------------------------------------------------
425
Parallel STL release within Intel(R) Parallel Studio XE 2019 Update 1
526
PSTL_VERSION == 202
627

CMakeLists.txt

+11-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,22 @@ set(PARALLELSTL_BACKEND "tbb" CACHE STRING "Threading backend; defaults to TBB")
3131

3232
include(CMakePackageConfigHelpers)
3333

34+
if (NOT TBB_DIR)
35+
get_filename_component(PSTL_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
36+
string(REPLACE pstl tbb TBB_DIR_NAME ${PSTL_DIR_NAME})
37+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../${TBB_DIR_NAME}/cmake")
38+
get_filename_component(TBB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${TBB_DIR_NAME}/cmake" ABSOLUTE)
39+
endif()
40+
endif()
41+
42+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
43+
3444
add_library(ParallelSTL INTERFACE)
3545
add_library(pstl::ParallelSTL ALIAS ParallelSTL)
3646

3747
if (PARALLELSTL_USE_PARALLEL_POLICIES)
3848
if (PARALLELSTL_BACKEND STREQUAL "tbb")
39-
find_package(TBB 2018 REQUIRED tbb)
49+
find_package(TBB 2018 REQUIRED tbb OPTIONAL_COMPONENTS tbbmalloc)
4050
message(STATUS "Parallel STL uses TBB ${TBB_VERSION} (interface version: ${TBB_INTERFACE_VERSION})")
4151
target_link_libraries(ParallelSTL INTERFACE TBB::tbb)
4252
else()

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Parallel STL
2-
[![Stable release](https://img.shields.io/badge/version-20181109-green.svg)](https://github.com/intel/parallelstl/releases/tag/20181109)
2+
[![Stable release](https://img.shields.io/badge/version-20181204-green.svg)](https://github.com/intel/parallelstl/releases/tag/20181204)
33
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)
44

55
Parallel STL is an implementation of the C++ standard library algorithms with support for execution policies,

build/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ $(PSTL_LIB_NAME):
5151
$(MAKE) -f $(PSTL_MAKEFILE) backend=$(backend) cfg=$(cfg)
5252

5353
test_%.exe: test_%$(OBJ_SFX) $(PSTL_LIB_NAME)
54-
$(info LIBRARY_PATH=$(LIBRARY_PATH))
5554
$(LD) $< $(LD_OUT_KEY)$@ $(LDFLAGS) $(DYN_LDFLAGS) $(PSTL_LIB_LINK)
5655

5756
test_%: test_%.exe
@@ -104,6 +103,9 @@ info:
104103
@echo OS = $(os_name)
105104
@echo proj_root = "$(proj_root)"
106105
@echo $(CURDIR)
107-
@echo VPATH=$(VPATH)
106+
@echo VPATH = $(VPATH)
107+
@echo LIBRARY_PATH = $(LIBRARY_PATH)
108+
@echo backend = $(backend)
109+
@echo compiler = $(compiler)
108110

109111
-include *.d

build/Makefile.common

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
.SUFFIXES:
2424

25-
ifeq (, $(filter $(MAKECMDGOALS), clean clean_all))
25+
goals = $(or $(MAKECMDGOALS),all)
26+
ifneq (, $(filter-out clean clean_all,$(goals)))
2627
ifeq (, $(filter $(backend), tbb))
2728
$(info Threading backend was not specified; using TBB)
2829
backend=tbb
@@ -64,7 +65,11 @@ endif
6465
target ?= $(os_name)
6566
#OS specific keys
6667
ifeq ($(target),windows)
67-
include $(proj_root)/build/windows.inc
68+
ifneq (, $(filter $(compiler), gcc g++))
69+
include $(proj_root)/build/mingw.inc
70+
else
71+
include $(proj_root)/build/windows.inc
72+
endif
6873
else
6974
include $(proj_root)/build/unix.inc
7075
ifneq (,$(wildcard $(proj_root)/build/$(target).inc))

build/gcc.inc

+4
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ ifneq (, $(shell gcc -dumpversion | egrep "^[5-9]\.[0-9]\.[0-9]"))
3131
endif
3232

3333
CPLUS_FLAGS += $(FQKEY)std=$(stdver)
34+
35+
ifeq ($(os_name),windows)
36+
DISABLED_WARNINGS = $(KEY)Wno-attributes #disable MinGW warnings about extended alignment
37+
endif

build/mingw.inc

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (c) 2017-2018 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
#
16+
#
17+
#
18+
19+
PYTHON = python
20+
KEY = -
21+
QKEY = $(KEY)q
22+
FKEY = $(KEY)
23+
FQKEY = $(KEY)
24+
MACHINE_KEY = $(KEY)m
25+
OBJ_SFX = .o
26+
DEL_CMD = del /F
27+
RUN_CMD =
28+
COMMAND_SEPARATOR = &
29+
compiler ?= gcc
30+
COMPILER_NOLOGO_KEY =
31+
OPTIMIZATION_DISABLED_FLAGS = $(KEY)Og $(KEY)g
32+
OPTIMIZATION_ENABLED_FLAGS += $(KEY)O2
33+
TBB_LIB_NAME = tbb
34+
CPLUS = $(compiler)
35+
LD = $(CPLUS)
36+
37+
USE_SHARED_CPPRUNTIME_KEY =
38+
LINK_KEY = $(KEY)l
39+
40+
LD_OUT_KEY = $(KEY)o
41+
DYN_LDFLAGS += -L. -L$(proj_root)/build
42+
43+
ifneq ($(PSTL_LIB_NAME), )
44+
PSTL_LIB_LINK += $(LINK_KEY)$(PSTL_LIB_NAME)$(PSTL_LIB_EXT)
45+
endif
46+
47+
ifeq ($(backend),tbb)
48+
DYN_LDFLAGS += $(LINK_KEY)$(TBB_LIB_NAME)
49+
endif
50+
51+
ifeq ($(arch),intel64)
52+
PSTL_ARCH = $(MACHINE_KEY)64
53+
else ifeq ($(arch),ia32)
54+
PSTL_ARCH = $(MACHINE_KEY)32
55+
else ifeq ($(arch),)
56+
$(info arch=native by default)
57+
else
58+
PSTL_ARCH = $(MACHINE_KEY)$(arch)
59+
endif

build/unix.inc

+1-8
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,12 @@ LINK_KEY = $(KEY)l
3939

4040
LD_OUT_KEY = $(KEY)o
4141
DYN_LDFLAGS += -L. -L$(proj_root)/build
42-
use_gold_linker ?= 0 # Use "gold" linker for test_algorithm when it runs on FreeBSD* 11 to avoid compilation errors
43-
44-
ifeq ($(use_gold_linker), 1)
45-
ifeq ($(cfg), debug)
46-
test_algorithm.exe: DYN_LDFLAGS += $(FQKEY)fuse-ld=gold
47-
endif
48-
endif
4942

5043
ifneq ($(PSTL_LIB_NAME), )
5144
PSTL_LIB_LINK += $(LINK_KEY)$(PSTL_LIB_NAME)$(PSTL_LIB_EXT)
5245
endif
5346

54-
ifneq (, $(filter $(backend), tbb))
47+
ifeq ($(backend), tbb)
5548
DYN_LDFLAGS += $(LINK_KEY)$(TBB_LIB_NAME)
5649
endif
5750

cmake/FindTBB.cmake

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright (c) 2018 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
#
16+
#
17+
#
18+
19+
include(FindPackageHandleStandardArgs)
20+
21+
# Firstly search for TBB in config mode (i.e. search for TBBConfig.cmake).
22+
find_package(TBB QUIET CONFIG)
23+
if (TBB_FOUND)
24+
find_package_handle_standard_args(TBB
25+
REQUIRED_VARS TBB_IMPORTED_TARGETS
26+
HANDLE_COMPONENTS
27+
VERSION_VAR TBB_VERSION
28+
CONFIG_MODE)
29+
return()
30+
endif()
31+
32+
if (NOT TBB_FIND_COMPONENTS)
33+
set(TBB_FIND_COMPONENTS tbb tbbmalloc)
34+
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
35+
set(TBB_FIND_REQUIRED_${_tbb_component} 1)
36+
endforeach()
37+
endif()
38+
39+
find_path(_tbb_include_dir tbb/tbb.h)
40+
if (_tbb_include_dir)
41+
file(READ "${_tbb_include_dir}/tbb/tbb_stddef.h" _tbb_stddef LIMIT 2048)
42+
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_stddef}")
43+
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_stddef}")
44+
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_stddef}")
45+
46+
set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}")
47+
48+
unset(_tbb_stddef)
49+
unset(_tbb_ver_major)
50+
unset(_tbb_ver_minor)
51+
52+
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
53+
find_library(_tbb_release_lib ${_tbb_component})
54+
if (_tbb_release_lib)
55+
set(TBB_${_tbb_component}_FOUND 1)
56+
57+
add_library(TBB::${_tbb_component} SHARED IMPORTED)
58+
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
59+
60+
set(_tbb_lib_suffix)
61+
if (UNIX AND NOT APPLE)
62+
set(_tbb_lib_suffix ".2")
63+
endif()
64+
65+
set_target_properties(TBB::${_tbb_component} PROPERTIES
66+
IMPORTED_CONFIGURATIONS "RELEASE"
67+
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}${_tbb_lib_suffix}"
68+
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_include_dir}")
69+
70+
find_library(_tbb_debug_lib ${_tbb_component}_debug)
71+
if (_tbb_debug_lib)
72+
set_target_properties(TBB::${_tbb_component} PROPERTIES
73+
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG"
74+
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}${_tbb_lib_suffix}")
75+
endif()
76+
unset(_tbb_debug_lib CACHE)
77+
unset(_tbb_lib_suffix)
78+
endif()
79+
unset(_tbb_release_lib CACHE)
80+
endforeach()
81+
endif()
82+
unset(_tbb_include_dir CACHE)
83+
84+
find_package_handle_standard_args(TBB
85+
REQUIRED_VARS TBB_IMPORTED_TARGETS
86+
HANDLE_COMPONENTS
87+
VERSION_VAR TBB_VERSION)

examples/convex_hull/readme.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ <h1 class="title">Parallel STL.<br>convex_hull sample</h1>
390390
<p>
391391
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
392392
<br>* Other names and brands may be claimed as the property of others.
393-
<br>&copy; 2017, Intel Corporation
393+
<br>&copy; 2017-2018, Intel Corporation
394394
</p>
395395
</div>
396396
</div>

0 commit comments

Comments
 (0)