Skip to content

numpy>=2 support #338

@vincefn

Description

@vincefn

It seems there is an issue related to numpy>=2:

In [1]: import skcuda.fft as cu_fft
/home/esrf/favre/.conda/envs/pynx-devel-numpy2-x86/lib/python3.12/site-packages/skcuda/cublas.py:284: UserWarning: creating CUBLAS context to get version number
  warnings.warn('creating CUBLAS context to get version number')
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[1], line 1
----> 1 import skcuda.fft as cu_fft

File ~/.conda/envs/pynx-devel-numpy2-x86/lib/python3.12/site-packages/skcuda/fft.py:20
     15 from .cufft import CUFFT_COMPATIBILITY_NATIVE, \
     16      CUFFT_COMPATIBILITY_FFTW_PADDING, \
     17      CUFFT_COMPATIBILITY_FFTW_ASYMMETRIC, \
     18      CUFFT_COMPATIBILITY_FFTW_ALL
     19 from . import cudart
---> 20 from . import misc
     22 class Plan:
     23     """
     24     CUFFT plan class.
     25 
   (...)     60         indicates whether the caller intends to allocate and manage the work area
     61     """

File ~/.conda/envs/pynx-devel-numpy2-x86/lib/python3.12/site-packages/skcuda/misc.py:637
    633 diff.cache = {}
    636 # List of available numerical types provided by numpy:
--> 637 num_types = [np.sctypeDict[t] for t in \
    638              np.typecodes['AllInteger']+np.typecodes['AllFloat']]
    640 # Numbers of bytes occupied by each numerical type:
    641 num_nbytes = dict((np.dtype(t),t(1).nbytes) for t in num_types)

KeyError: 'b'

Also:

  File "/home/esrf/favre/.conda/envs/pynx-devel-numpy2-x86/lib/python3.12/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
AttributeError: `np.sctypes` was removed in the NumPy 2.0 release. Access dtypes explicitly instead.

PR incoming

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions