Skip to content

Commit

Permalink
Committing Parallel STL 20181204 open source release
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed Dec 4, 2018
1 parent f2d2990 commit 972f98e
Show file tree
Hide file tree
Showing 88 changed files with 2,330 additions and 1,805 deletions.
21 changes: 21 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
------------------------------------------------------------------------
The list of most significant changes made over time in Parallel STL.

Parallel STL 20181204 release
PSTL_VERSION == 203

Features / APIs:

- More algorithms support parallel execution policies:
set_union, set_intersection, set_difference, set_symmetric_difference.
- Improved performance in reverse, reverse_copy algorithm with vector
execution policies.
- Added FindTBB CMake module - Preview Feature.

Bugs fixed:

- Fixed several algorithms which use scan and reduction patterns with
a user defined binary operation with vector execution policies.

Examples:

- CMake support for gamma_correction sample was added.

------------------------------------------------------------------------
Parallel STL release within Intel(R) Parallel Studio XE 2019 Update 1
PSTL_VERSION == 202

Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ set(PARALLELSTL_BACKEND "tbb" CACHE STRING "Threading backend; defaults to TBB")

include(CMakePackageConfigHelpers)

if (NOT TBB_DIR)
get_filename_component(PSTL_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE pstl tbb TBB_DIR_NAME ${PSTL_DIR_NAME})
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../${TBB_DIR_NAME}/cmake")
get_filename_component(TBB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${TBB_DIR_NAME}/cmake" ABSOLUTE)
endif()
endif()

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

add_library(ParallelSTL INTERFACE)
add_library(pstl::ParallelSTL ALIAS ParallelSTL)

if (PARALLELSTL_USE_PARALLEL_POLICIES)
if (PARALLELSTL_BACKEND STREQUAL "tbb")
find_package(TBB 2018 REQUIRED tbb)
find_package(TBB 2018 REQUIRED tbb OPTIONAL_COMPONENTS tbbmalloc)
message(STATUS "Parallel STL uses TBB ${TBB_VERSION} (interface version: ${TBB_INTERFACE_VERSION})")
target_link_libraries(ParallelSTL INTERFACE TBB::tbb)
else()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parallel STL
[![Stable release](https://img.shields.io/badge/version-20181109-green.svg)](https://github.com/intel/parallelstl/releases/tag/20181109)
[![Stable release](https://img.shields.io/badge/version-20181204-green.svg)](https://github.com/intel/parallelstl/releases/tag/20181204)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)

Parallel STL is an implementation of the C++ standard library algorithms with support for execution policies,
Expand Down
6 changes: 4 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ $(PSTL_LIB_NAME):
$(MAKE) -f $(PSTL_MAKEFILE) backend=$(backend) cfg=$(cfg)

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

test_%: test_%.exe
Expand Down Expand Up @@ -104,6 +103,9 @@ info:
@echo OS = $(os_name)
@echo proj_root = "$(proj_root)"
@echo $(CURDIR)
@echo VPATH=$(VPATH)
@echo VPATH = $(VPATH)
@echo LIBRARY_PATH = $(LIBRARY_PATH)
@echo backend = $(backend)
@echo compiler = $(compiler)

-include *.d
9 changes: 7 additions & 2 deletions build/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

.SUFFIXES:

ifeq (, $(filter $(MAKECMDGOALS), clean clean_all))
goals = $(or $(MAKECMDGOALS),all)
ifneq (, $(filter-out clean clean_all,$(goals)))
ifeq (, $(filter $(backend), tbb))
$(info Threading backend was not specified; using TBB)
backend=tbb
Expand Down Expand Up @@ -64,7 +65,11 @@ endif
target ?= $(os_name)
#OS specific keys
ifeq ($(target),windows)
include $(proj_root)/build/windows.inc
ifneq (, $(filter $(compiler), gcc g++))
include $(proj_root)/build/mingw.inc
else
include $(proj_root)/build/windows.inc
endif
else
include $(proj_root)/build/unix.inc
ifneq (,$(wildcard $(proj_root)/build/$(target).inc))
Expand Down
4 changes: 4 additions & 0 deletions build/gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ ifneq (, $(shell gcc -dumpversion | egrep "^[5-9]\.[0-9]\.[0-9]"))
endif

CPLUS_FLAGS += $(FQKEY)std=$(stdver)

ifeq ($(os_name),windows)
DISABLED_WARNINGS = $(KEY)Wno-attributes #disable MinGW warnings about extended alignment
endif
59 changes: 59 additions & 0 deletions build/mingw.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (c) 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
#
#

PYTHON = python
KEY = -
QKEY = $(KEY)q
FKEY = $(KEY)
FQKEY = $(KEY)
MACHINE_KEY = $(KEY)m
OBJ_SFX = .o
DEL_CMD = del /F
RUN_CMD =
COMMAND_SEPARATOR = &
compiler ?= gcc
COMPILER_NOLOGO_KEY =
OPTIMIZATION_DISABLED_FLAGS = $(KEY)Og $(KEY)g
OPTIMIZATION_ENABLED_FLAGS += $(KEY)O2
TBB_LIB_NAME = tbb
CPLUS = $(compiler)
LD = $(CPLUS)

USE_SHARED_CPPRUNTIME_KEY =
LINK_KEY = $(KEY)l

LD_OUT_KEY = $(KEY)o
DYN_LDFLAGS += -L. -L$(proj_root)/build

ifneq ($(PSTL_LIB_NAME), )
PSTL_LIB_LINK += $(LINK_KEY)$(PSTL_LIB_NAME)$(PSTL_LIB_EXT)
endif

ifeq ($(backend),tbb)
DYN_LDFLAGS += $(LINK_KEY)$(TBB_LIB_NAME)
endif

ifeq ($(arch),intel64)
PSTL_ARCH = $(MACHINE_KEY)64
else ifeq ($(arch),ia32)
PSTL_ARCH = $(MACHINE_KEY)32
else ifeq ($(arch),)
$(info arch=native by default)
else
PSTL_ARCH = $(MACHINE_KEY)$(arch)
endif
9 changes: 1 addition & 8 deletions build/unix.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,12 @@ LINK_KEY = $(KEY)l

LD_OUT_KEY = $(KEY)o
DYN_LDFLAGS += -L. -L$(proj_root)/build
use_gold_linker ?= 0 # Use "gold" linker for test_algorithm when it runs on FreeBSD* 11 to avoid compilation errors

ifeq ($(use_gold_linker), 1)
ifeq ($(cfg), debug)
test_algorithm.exe: DYN_LDFLAGS += $(FQKEY)fuse-ld=gold
endif
endif

ifneq ($(PSTL_LIB_NAME), )
PSTL_LIB_LINK += $(LINK_KEY)$(PSTL_LIB_NAME)$(PSTL_LIB_EXT)
endif

ifneq (, $(filter $(backend), tbb))
ifeq ($(backend), tbb)
DYN_LDFLAGS += $(LINK_KEY)$(TBB_LIB_NAME)
endif

Expand Down
87 changes: 87 additions & 0 deletions cmake/FindTBB.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
#
#

include(FindPackageHandleStandardArgs)

# Firstly search for TBB in config mode (i.e. search for TBBConfig.cmake).
find_package(TBB QUIET CONFIG)
if (TBB_FOUND)
find_package_handle_standard_args(TBB
REQUIRED_VARS TBB_IMPORTED_TARGETS
HANDLE_COMPONENTS
VERSION_VAR TBB_VERSION
CONFIG_MODE)
return()
endif()

if (NOT TBB_FIND_COMPONENTS)
set(TBB_FIND_COMPONENTS tbb tbbmalloc)
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
set(TBB_FIND_REQUIRED_${_tbb_component} 1)
endforeach()
endif()

find_path(_tbb_include_dir tbb/tbb.h)
if (_tbb_include_dir)
file(READ "${_tbb_include_dir}/tbb/tbb_stddef.h" _tbb_stddef LIMIT 2048)
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_stddef}")
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_stddef}")
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_stddef}")

set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}")

unset(_tbb_stddef)
unset(_tbb_ver_major)
unset(_tbb_ver_minor)

foreach (_tbb_component ${TBB_FIND_COMPONENTS})
find_library(_tbb_release_lib ${_tbb_component})
if (_tbb_release_lib)
set(TBB_${_tbb_component}_FOUND 1)

add_library(TBB::${_tbb_component} SHARED IMPORTED)
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})

set(_tbb_lib_suffix)
if (UNIX AND NOT APPLE)
set(_tbb_lib_suffix ".2")
endif()

set_target_properties(TBB::${_tbb_component} PROPERTIES
IMPORTED_CONFIGURATIONS "RELEASE"
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}${_tbb_lib_suffix}"
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_include_dir}")

find_library(_tbb_debug_lib ${_tbb_component}_debug)
if (_tbb_debug_lib)
set_target_properties(TBB::${_tbb_component} PROPERTIES
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG"
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}${_tbb_lib_suffix}")
endif()
unset(_tbb_debug_lib CACHE)
unset(_tbb_lib_suffix)
endif()
unset(_tbb_release_lib CACHE)
endforeach()
endif()
unset(_tbb_include_dir CACHE)

find_package_handle_standard_args(TBB
REQUIRED_VARS TBB_IMPORTED_TARGETS
HANDLE_COMPONENTS
VERSION_VAR TBB_VERSION)
2 changes: 1 addition & 1 deletion examples/convex_hull/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ <h1 class="title">Parallel STL.<br>convex_hull sample</h1>
<p>
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
<br>* Other names and brands may be claimed as the property of others.
<br>&copy; 2017, Intel Corporation
<br>&copy; 2017-2018, Intel Corporation
</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 972f98e

Please sign in to comment.