Skip to content

Commit

Permalink
Set _threading_type at compile time
Browse files Browse the repository at this point in the history
This variable can be used at run-time to detect whether compilation was
done against OpenMP, PTHREADS or without multithreading.
  • Loading branch information
grlee77 committed Sep 17, 2018
1 parent 2f9d3c0 commit e17d3c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyfftw/pyfftw.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ IF HAVE_LONG:
_supported_nptypes_complex.append(np.clongdouble)
_supported_nptypes_real.append(np.longdouble)

IF (HAVE_SINGLE_OMP or HAVE_DOUBLE_OMP or HAVE_LONG_OMP):
_threading_type = 'OMP'
ELIF (HAVE_SINGLE_THREADS or HAVE_DOUBLE_THREADS or HAVE_LONG_THREADS):
_threading_type = 'PTHREADS'
ELSE:
_threading_type = None

cdef object directions
directions = {'FFTW_FORWARD': FFTW_FORWARD,
'FFTW_BACKWARD': FFTW_BACKWARD}
Expand Down

0 comments on commit e17d3c6

Please sign in to comment.