Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tbb to 2020 3 #2447

Merged
merged 12 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove normal priority argument in new interface init threadpool so 2…
…020_U3 can use the new interface
  • Loading branch information
SteveBronder committed Mar 23, 2021
commit 420b2eafdee92902230d5f688c60c67700527583
3 changes: 3 additions & 0 deletions lib/tbb_2020.3/STAN_CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file documents changes done for the stan-math project

- drop -g flag from makefiles for release mode builds to decrease size of binaries
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/BSD.clang.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ LINK_FLAGS = -Wl,-rpath-link=. -Wl,-rpath=. -rdynamic
C_FLAGS = $(CPLUS_FLAGS)

ifeq ($(cfg), release)
CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
Expand Down
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/FreeBSD.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ifneq (,$(shell gcc -dumpfullversion -dumpversion | egrep "^([6-9]|1[0-9])"))
endif

ifeq ($(cfg), release)
CPLUS_FLAGS = -g -O2 -DUSE_PTHREAD
CPLUS_FLAGS = -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_USE_DEBUG -g -O0 -DUSE_PTHREAD
Expand Down
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/SunOS.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LIBS = -lpthread -lrt -ldl
C_FLAGS = $(CPLUS_FLAGS) -x c

ifeq ($(cfg), release)
CPLUS_FLAGS = -g -O2 -DUSE_PTHREAD
CPLUS_FLAGS = -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_USE_DEBUG -g -O0 -DUSE_PTHREAD
Expand Down
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/linux.clang.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ C_FLAGS = $(CPLUS_FLAGS)

ifeq ($(cfg), release)
# -g is set intentionally in the release mode. It should not affect performance.
CPLUS_FLAGS = -O2 -g
CPLUS_FLAGS = -O2
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_USE_DEBUG -O0 -g
Expand Down
3 changes: 1 addition & 2 deletions lib/tbb_2020.3/build/linux.icc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ITT_NOTIFY = -DDO_ITT_NOTIFY
ifeq (release,$(cfg))
SDL_FLAGS += -D_FORTIFY_SOURCE=2
# -g is set intentionally in the release mode. It should not affect performance.
CPLUS_FLAGS = -O2 -g -qno-opt-report-embed
CPLUS_FLAGS = -O2 -qno-opt-report-embed
else
CPLUS_FLAGS = -O0 -g -DTBB_USE_DEBUG
endif
Expand Down Expand Up @@ -116,4 +116,3 @@ M_CPLUS_FLAGS = $(CPLUS_FLAGS) -fno-rtti -fno-exceptions
#------------------------------------------------------------------------------
# End of setting tbbmalloc data.
#------------------------------------------------------------------------------

2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/linux.pathcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ C_FLAGS = $(CPLUS_FLAGS)
OPENMP_FLAG = -openmp

ifeq ($(cfg), release)
CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
Expand Down
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/macos.clang.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ LIB_LINK_FLAGS = -dynamiclib -install_name @rpath/$(BUILDING_LIBRARY)
C_FLAGS = $(CPLUS_FLAGS)

ifeq ($(cfg), release)
CPLUS_FLAGS = -g -O2
CPLUS_FLAGS = -O2
else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif
Expand Down
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/macos.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9]|1[0-9])
endif

ifeq ($(cfg), release)
CPLUS_FLAGS = -g -O2
CPLUS_FLAGS = -O2
else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif
Expand Down
2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/macos.icc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endif

ifeq ($(cfg), release)
SDL_FLAGS += -D_FORTIFY_SOURCE=2
CPLUS_FLAGS = -g -O2 -fno-omit-frame-pointer -qno-opt-report-embed
CPLUS_FLAGS = -O2 -fno-omit-frame-pointer -qno-opt-report-embed
else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif
Expand Down
5 changes: 1 addition & 4 deletions lib/tbb_2020.3/build/mic.icc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SDL_FLAGS = -fstack-protector -Wformat -Wformat-security

ifeq (release,$(cfg))
SDL_FLAGS += -D_FORTIFY_SOURCE=2
CPLUS_FLAGS = -O2 -g -DUSE_PTHREAD
CPLUS_FLAGS = -O2 -DUSE_PTHREAD
else
CPLUS_FLAGS = -O0 -g -DUSE_PTHREAD -DTBB_USE_DEBUG
endif
Expand Down Expand Up @@ -70,6 +70,3 @@ M_CPLUS_FLAGS = $(CPLUS_FLAGS) -fno-rtti -fno-exceptions
#------------------------------------------------------------------------------
# End of setting tbbmalloc data.
#------------------------------------------------------------------------------



2 changes: 1 addition & 1 deletion lib/tbb_2020.3/build/windows.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ifeq (ok,$(call detect_js,/minversion gcc 6.0))
endif

ifeq ($(cfg), release)
CPLUS_FLAGS = -g -O2
CPLUS_FLAGS = -O2
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
Expand Down
3 changes: 1 addition & 2 deletions stan/math/prim/core/init_threadpool_tbb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ inline tbb::task_arena& init_threadpool_tbb() {
static tbb::global_control tbb_gc(
tbb::global_control::max_allowed_parallelism, tbb_max_threads);

static tbb::task_arena tbb_arena(tbb_max_threads, 1,
tbb::task_arena::priority::normal);
static tbb::task_arena tbb_arena(tbb_max_threads, 1);
tbb_arena.initialize();

return tbb_arena;
Expand Down