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

Release OpenMP resources in blas_thread_shutdown #4080

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions driver/others/blas_server_omp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

#else

#include <omp.h>
#ifndef likely
#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
Expand Down Expand Up @@ -147,6 +148,9 @@ int BLASFUNC(blas_thread_shutdown)(void){
}
}
}
#if defined(_OPENMP) && _OPENMP >= 201811
omp_pause_resource_all(omp_pause_hard);
#endif

return 0;
}
Expand Down
5 changes: 1 addition & 4 deletions utest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ endif
#this does not work with OpenMP nor with native Windows or Android threads
# FIXME TBD if this works on OSX, SunOS, POWER and zarch
ifeq ($(OSNAME), $(filter $(OSNAME),Linux CYGWIN_NT))
ifneq ($(USE_OPENMP), 1)
OBJS += test_fork.o
endif
OBJS += test_post_fork.o
OBJS += test_fork.o test_post_fork.o
endif

ifeq ($(C_COMPILER), PGI)
Expand Down
2 changes: 1 addition & 1 deletion utest/test_fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void check_dgemm(double *a, double *b, double *result, double *expected,

CTEST(fork, safety)
{
#ifndef BUILD_DOUBLE
#if !defined(BUILD_DOUBLE) || (defined(_OPENMP) && _OPENMP < 201811)
exit(0);
#else
blasint n = 1000;
Expand Down