Skip to content

Commit 6029108

Browse files
Reinstate call to import_array
This inserts call to initialize function pointer struct during initialization of _pydfti extension, and helps build mkl_fft with Cython <3
1 parent 8431635 commit 6029108

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mkl_fft/_pydfti.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ cdef extern from "src/mklfft.h":
137137
char * mkl_dfti_error(int)
138138

139139

140+
# Initialize numpy
141+
cdef int numpy_import_status = cnp.import_array()
142+
if numpy_import_status < 0:
143+
raise ImportError("Failed to import NumPy as dependency of mkl_fft")
144+
145+
140146
cdef int _datacopied(cnp.ndarray arr, object orig):
141147
"""
142148
Strict check for `arr` not sharing any data with `original`,

0 commit comments

Comments
 (0)