From 3b6531792f6674fd5d723345925d8eab5a07f62f Mon Sep 17 00:00:00 2001 From: zzjjbb <31069326+zzjjbb@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:46:27 -0500 Subject: [PATCH] Update for NumPy 2.0+ compatibility --- skcuda/fft.py | 8 ++++---- skcuda/misc.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/skcuda/fft.py b/skcuda/fft.py index 5ec04a36..e7d86f69 100644 --- a/skcuda/fft.py +++ b/skcuda/fft.py @@ -186,13 +186,13 @@ def _fft(x_gpu, y_gpu, plan, direction, scale=None): raise ValueError('can only compute in-place transform of complex data') if direction == cufft.CUFFT_FORWARD and \ - plan.in_dtype in np.sctypes['complex'] and \ - plan.out_dtype in np.sctypes['float']: + plan.in_dtype in [np.dtype(t).type for t in np.typecodes['Complex']] and \ + plan.out_dtype in [np.dtype(t).type for t in np.typecodes['Float']]: raise ValueError('cannot compute forward complex -> real transform') if direction == cufft.CUFFT_INVERSE and \ - plan.in_dtype in np.sctypes['float'] and \ - plan.out_dtype in np.sctypes['complex']: + plan.in_dtype in [np.dtype(t).type for t in np.typecodes['Float']] and \ + plan.out_dtype in [np.dtype(t).type for t in np.typecodes['Complex']]: raise ValueError('cannot compute inverse real -> complex transform') if plan.fft_type in [cufft.CUFFT_C2C, cufft.CUFFT_Z2Z]: diff --git a/skcuda/misc.py b/skcuda/misc.py index 63dea7c1..68baa2f3 100644 --- a/skcuda/misc.py +++ b/skcuda/misc.py @@ -634,7 +634,7 @@ def diff(x_gpu): # List of available numerical types provided by numpy: -num_types = [np.sctypeDict[t] for t in \ +num_types = [np.dtype(t).type for t in \ np.typecodes['AllInteger']+np.typecodes['AllFloat']] # Numbers of bytes occupied by each numerical type: