Skip to content

Stubs missing for numpy._core._simd (module only) #111

@jorenham

Description

@jorenham

numpy._core does not export this submodule


cleaned & fixed stubgen 1.15.0 output:

from types import ModuleType

SSE42: ModuleType | None = ...
AVX2: ModuleType | None = ...
FMA3: ModuleType | None = ...
AVX512F: ModuleType | None = ...
AVX512_SKX: ModuleType | None = ...
baseline: ModuleType | None = ...

# TODO(jorenham): TypedDict
targets: dict[str, ModuleType | None] = ...

def clear_floatstatus() -> None: ...
def get_floatstatus() -> int: ...

The CPU-specific submodules live in numpy._core._simd, and contain a huge amount of functions:

>>> from numpy._core import _simd
>>> _simd.AVX2
<module 'numpy._core._simd.AVX2'>
>>> dir(_simd.AVX2)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'abs_f32', 'abs_f64', 'add_f32', 'add_f64', 'add_s16', 'add_s32', 'add_s64', 'add_s8', 'add_u16', 'add_u32', 'add_u64', 'add_u8', 'adds_s16', 'adds_s8', 'adds_u16', 'adds_u8', 'all_b16', 'all_b32', 'all_b64', 'all_b8', 'all_f32', 'all_f64', 'all_s16', 'all_s32', 'all_s64', 'all_s8', 'all_u16', 'all_u32', 'all_u64', 'all_u8', 'and_b16', 'and_b32', 'and_b64', 'and_b8', 'and_f32', 'and_f64', 'and_s16', 'and_s32', 'and_s64', 'and_s8', 'and_u16', 'and_u32', 'and_u64', 'and_u8', 'andc_b8', 'andc_u8', 'any_b16', 'any_b32', 'any_b64', 'any_b8', 'any_f32', 'any_f64', 'any_s16', 'any_s32', 'any_s64', 'any_s8', 'any_u16', 'any_u32', 'any_u64', 'any_u8', 'ceil_f32', 'ceil_f64', 'cleanup', 'cmpeq_f32', 'cmpeq_f64', 'cmpeq_s16', 'cmpeq_s32', 'cmpeq_s64', 'cmpeq_s8', 'cmpeq_u16', 'cmpeq_u32', 'cmpeq_u64', 'cmpeq_u8', 'cmpge_f32', 'cmpge_f64', 'cmpge_s16', 'cmpge_s32', 'cmpge_s64', 'cmpge_s8', 'cmpge_u16', 'cmpge_u32', 'cmpge_u64', 'cmpge_u8', 'cmpgt_f32', 'cmpgt_f64', 'cmpgt_s16', 'cmpgt_s32', 'cmpgt_s64', 'cmpgt_s8', 'cmpgt_u16', 'cmpgt_u32', 'cmpgt_u64', 'cmpgt_u8', 'cmple_f32', 'cmple_f64', 'cmple_s16', 'cmple_s32', 'cmple_s64', 'cmple_s8', 'cmple_u16', 'cmple_u32', 'cmple_u64', 'cmple_u8', 'cmplt_f32', 'cmplt_f64', 'cmplt_s16', 'cmplt_s32', 'cmplt_s64', 'cmplt_s8', 'cmplt_u16', 'cmplt_u32', 'cmplt_u64', 'cmplt_u8', 'cmpneq_f32', 'cmpneq_f64', 'cmpneq_s16', 'cmpneq_s32', 'cmpneq_s64', 'cmpneq_s8', 'cmpneq_u16', 'cmpneq_u32', 'cmpneq_u64', 'cmpneq_u8', 'combine_f32', 'combine_f64', 'combine_s16', 'combine_s32', 'combine_s64', 'combine_s8', 'combine_u16', 'combine_u32', 'combine_u64', 'combine_u8', 'combineh_f32', 'combineh_f64', 'combineh_s16', 'combineh_s32', 'combineh_s64', 'combineh_s8', 'combineh_u16', 'combineh_u32', 'combineh_u64', 'combineh_u8', 'combinel_f32', 'combinel_f64', 'combinel_s16', 'combinel_s32', 'combinel_s64', 'combinel_s8', 'combinel_u16', 'combinel_u32', 'combinel_u64', 'combinel_u8', 'cvt_b16_s16', 'cvt_b16_u16', 'cvt_b32_f32', 'cvt_b32_s32', 'cvt_b32_u32', 'cvt_b64_f64', 'cvt_b64_s64', 'cvt_b64_u64', 'cvt_b8_s8', 'cvt_b8_u8', 'cvt_f32_b32', 'cvt_f64_b64', 'cvt_s16_b16', 'cvt_s32_b32', 'cvt_s64_b64', 'cvt_s8_b8', 'cvt_u16_b16', 'cvt_u32_b32', 'cvt_u64_b64', 'cvt_u8_b8', 'div_f32', 'div_f64', 'divc_s16', 'divc_s32', 'divc_s64', 'divc_s8', 'divc_u16', 'divc_u32', 'divc_u64', 'divc_u8', 'divisor_s16', 'divisor_s32', 'divisor_s64', 'divisor_s8', 'divisor_u16', 'divisor_u32', 'divisor_u64', 'divisor_u8', 'expand_u16_u8', 'expand_u32_u16', 'extract0_f32', 'extract0_f64', 'extract0_s16', 'extract0_s32', 'extract0_s64', 'extract0_s8', 'extract0_u16', 'extract0_u32', 'extract0_u64', 'extract0_u8', 'floor_f32', 'floor_f64', 'ifadd_f32', 'ifadd_f64', 'ifadd_s16', 'ifadd_s32', 'ifadd_s64', 'ifadd_s8', 'ifadd_u16', 'ifadd_u32', 'ifadd_u64', 'ifadd_u8', 'ifdiv_f32', 'ifdiv_f64', 'ifdivz_f32', 'ifdivz_f64', 'ifsub_f32', 'ifsub_f64', 'ifsub_s16', 'ifsub_s32', 'ifsub_s64', 'ifsub_s8', 'ifsub_u16', 'ifsub_u32', 'ifsub_u64', 'ifsub_u8', 'load2_till_f32', 'load2_till_f64', 'load2_till_s32', 'load2_till_s64', 'load2_till_u32', 'load2_till_u64', 'load2_tillz_f32', 'load2_tillz_f64', 'load2_tillz_s32', 'load2_tillz_s64', 'load2_tillz_u32', 'load2_tillz_u64', 'load_f32', 'load_f32x2', 'load_f64', 'load_f64x2', 'load_s16', 'load_s16x2', 'load_s32', 'load_s32x2', 'load_s64', 'load_s64x2', 'load_s8', 'load_s8x2', 'load_till_f32', 'load_till_f64', 'load_till_s32', 'load_till_s64', 'load_till_u32', 'load_till_u64', 'load_tillz_f32', 'load_tillz_f64', 'load_tillz_s32', 'load_tillz_s64', 'load_tillz_u32', 'load_tillz_u64', 'load_u16', 'load_u16x2', 'load_u32', 'load_u32x2', 'load_u64', 'load_u64x2', 'load_u8', 'load_u8x2', 'loada_f32', 'loada_f64', 'loada_s16', 'loada_s32', 'loada_s64', 'loada_s8', 'loada_u16', 'loada_u32', 'loada_u64', 'loada_u8', 'loadl_f32', 'loadl_f64', 'loadl_s16', 'loadl_s32', 'loadl_s64', 'loadl_s8', 'loadl_u16', 'loadl_u32', 'loadl_u64', 'loadl_u8', 'loadn2_f32', 'loadn2_f64', 'loadn2_s32', 'loadn2_s64', 'loadn2_till_f32', 'loadn2_till_f64', 'loadn2_till_s32', 'loadn2_till_s64', 'loadn2_till_u32', 'loadn2_till_u64', 'loadn2_tillz_f32', 'loadn2_tillz_f64', 'loadn2_tillz_s32', 'loadn2_tillz_s64', 'loadn2_tillz_u32', 'loadn2_tillz_u64', 'loadn2_u32', 'loadn2_u64', 'loadn_f32', 'loadn_f64', 'loadn_s32', 'loadn_s64', 'loadn_till_f32', 'loadn_till_f64', 'loadn_till_s32', 'loadn_till_s64', 'loadn_till_u32', 'loadn_till_u64', 'loadn_tillz_f32', 'loadn_tillz_f64', 'loadn_tillz_s32', 'loadn_tillz_s64', 'loadn_tillz_u32', 'loadn_tillz_u64', 'loadn_u32', 'loadn_u64', 'loads_f32', 'loads_f64', 'loads_s16', 'loads_s32', 'loads_s64', 'loads_s8', 'loads_u16', 'loads_u32', 'loads_u64', 'loads_u8', 'lut16_f64', 'lut16_s64', 'lut16_u64', 'lut32_f32', 'lut32_s32', 'lut32_u32', 'max_f32', 'max_f64', 'max_s16', 'max_s32', 'max_s64', 'max_s8', 'max_u16', 'max_u32', 'max_u64', 'max_u8', 'maxn_f32', 'maxn_f64', 'maxp_f32', 'maxp_f64', 'min_f32', 'min_f64', 'min_s16', 'min_s32', 'min_s64', 'min_s8', 'min_u16', 'min_u32', 'min_u64', 'min_u8', 'minn_f32', 'minn_f64', 'minp_f32', 'minp_f64', 'mul_f32', 'mul_f64', 'mul_s16', 'mul_s32', 'mul_s8', 'mul_u16', 'mul_u32', 'mul_u8', 'muladd_f32', 'muladd_f64', 'muladdsub_f32', 'muladdsub_f64', 'mulsub_f32', 'mulsub_f64', 'nlanes_f32', 'nlanes_f64', 'nlanes_s16', 'nlanes_s32', 'nlanes_s64', 'nlanes_s8', 'nlanes_u16', 'nlanes_u32', 'nlanes_u64', 'nlanes_u8', 'nmuladd_f32', 'nmuladd_f64', 'nmulsub_f32', 'nmulsub_f64', 'not_b16', 'not_b32', 'not_b64', 'not_b8', 'not_f32', 'not_f64', 'not_s16', 'not_s32', 'not_s64', 'not_s8', 'not_u16', 'not_u32', 'not_u64', 'not_u8', 'notnan_f32', 'notnan_f64', 'or_b16', 'or_b32', 'or_b64', 'or_b8', 'or_f32', 'or_f64', 'or_s16', 'or_s32', 'or_s64', 'or_s8', 'or_u16', 'or_u32', 'or_u64', 'or_u8', 'orc_b8', 'pack_b8_b16', 'pack_b8_b32', 'pack_b8_b64', 'permi128_f32', 'permi128_f64', 'permi128_s32', 'permi128_s64', 'permi128_u32', 'permi128_u64', 'recip_f32', 'recip_f64', 'reduce_max_f32', 'reduce_max_f64', 'reduce_max_s16', 'reduce_max_s32', 'reduce_max_s64', 'reduce_max_s8', 'reduce_max_u16', 'reduce_max_u32', 'reduce_max_u64', 'reduce_max_u8', 'reduce_maxn_f32', 'reduce_maxn_f64', 'reduce_maxp_f32', 'reduce_maxp_f64', 'reduce_min_f32', 'reduce_min_f64', 'reduce_min_s16', 'reduce_min_s32', 'reduce_min_s64', 'reduce_min_s8', 'reduce_min_u16', 'reduce_min_u32', 'reduce_min_u64', 'reduce_min_u8', 'reduce_minn_f32', 'reduce_minn_f64', 'reduce_minp_f32', 'reduce_minp_f64', 'reinterpret_f32_f32', 'reinterpret_f32_f64', 'reinterpret_f32_s16', 'reinterpret_f32_s32', 'reinterpret_f32_s64', 'reinterpret_f32_s8', 'reinterpret_f32_u16', 'reinterpret_f32_u32', 'reinterpret_f32_u64', 'reinterpret_f32_u8', 'reinterpret_f64_f32', 'reinterpret_f64_f64', 'reinterpret_f64_s16', 'reinterpret_f64_s32', 'reinterpret_f64_s64', 'reinterpret_f64_s8', 'reinterpret_f64_u16', 'reinterpret_f64_u32', 'reinterpret_f64_u64', 'reinterpret_f64_u8', 'reinterpret_s16_f32', 'reinterpret_s16_f64', 'reinterpret_s16_s16', 'reinterpret_s16_s32', 'reinterpret_s16_s64', 'reinterpret_s16_s8', 'reinterpret_s16_u16', 'reinterpret_s16_u32', 'reinterpret_s16_u64', 'reinterpret_s16_u8', 'reinterpret_s32_f32', 'reinterpret_s32_f64', 'reinterpret_s32_s16', 'reinterpret_s32_s32', 'reinterpret_s32_s64', 'reinterpret_s32_s8', 'reinterpret_s32_u16', 'reinterpret_s32_u32', 'reinterpret_s32_u64', 'reinterpret_s32_u8', 'reinterpret_s64_f32', 'reinterpret_s64_f64', 'reinterpret_s64_s16', 'reinterpret_s64_s32', 'reinterpret_s64_s64', 'reinterpret_s64_s8', 'reinterpret_s64_u16', 'reinterpret_s64_u32', 'reinterpret_s64_u64', 'reinterpret_s64_u8', 'reinterpret_s8_f32', 'reinterpret_s8_f64', 'reinterpret_s8_s16', 'reinterpret_s8_s32', 'reinterpret_s8_s64', 'reinterpret_s8_s8', 'reinterpret_s8_u16', 'reinterpret_s8_u32', 'reinterpret_s8_u64', 'reinterpret_s8_u8', 'reinterpret_u16_f32', 'reinterpret_u16_f64', 'reinterpret_u16_s16', 'reinterpret_u16_s32', 'reinterpret_u16_s64', 'reinterpret_u16_s8', 'reinterpret_u16_u16', 'reinterpret_u16_u32', 'reinterpret_u16_u64', 'reinterpret_u16_u8', 'reinterpret_u32_f32', 'reinterpret_u32_f64', 'reinterpret_u32_s16', 'reinterpret_u32_s32', 'reinterpret_u32_s64', 'reinterpret_u32_s8', 'reinterpret_u32_u16', 'reinterpret_u32_u32', 'reinterpret_u32_u64', 'reinterpret_u32_u8', 'reinterpret_u64_f32', 'reinterpret_u64_f64', 'reinterpret_u64_s16', 'reinterpret_u64_s32', 'reinterpret_u64_s64', 'reinterpret_u64_s8', 'reinterpret_u64_u16', 'reinterpret_u64_u32', 'reinterpret_u64_u64', 'reinterpret_u64_u8', 'reinterpret_u8_f32', 'reinterpret_u8_f64', 'reinterpret_u8_s16', 'reinterpret_u8_s32', 'reinterpret_u8_s64', 'reinterpret_u8_s8', 'reinterpret_u8_u16', 'reinterpret_u8_u32', 'reinterpret_u8_u64', 'reinterpret_u8_u8', 'rev64_f32', 'rev64_s16', 'rev64_s32', 'rev64_s8', 'rev64_u16', 'rev64_u32', 'rev64_u8', 'rint_f32', 'rint_f64', 'round_s32_f32', 'round_s32_f64', 'select_f32', 'select_f64', 'select_s16', 'select_s32', 'select_s64', 'select_s8', 'select_u16', 'select_u32', 'select_u64', 'select_u8', 'set_f32', 'set_f64', 'set_s16', 'set_s32', 'set_s64', 'set_s8', 'set_u16', 'set_u32', 'set_u64', 'set_u8', 'setall_f32', 'setall_f64', 'setall_s16', 'setall_s32', 'setall_s64', 'setall_s8', 'setall_u16', 'setall_u32', 'setall_u64', 'setall_u8', 'setf_f32', 'setf_f64', 'setf_s16', 'setf_s32', 'setf_s64', 'setf_s8', 'setf_u16', 'setf_u32', 'setf_u64', 'setf_u8', 'shl_s16', 'shl_s32', 'shl_s64', 'shl_u16', 'shl_u32', 'shl_u64', 'shli_s16', 'shli_s32', 'shli_s64', 'shli_u16', 'shli_u32', 'shli_u64', 'shr_s16', 'shr_s32', 'shr_s64', 'shr_u16', 'shr_u32', 'shr_u64', 'shri_s16', 'shri_s32', 'shri_s64', 'shri_u16', 'shri_u32', 'shri_u64', 'simd', 'simd_bigendian', 'simd_f32', 'simd_f64', 'simd_fma3', 'simd_width', 'sqrt_f32', 'sqrt_f64', 'square_f32', 'square_f64', 'store2_till_f32', 'store2_till_f64', 'store2_till_s32', 'store2_till_s64', 'store2_till_u32', 'store2_till_u64', 'store_f32', 'store_f32x2', 'store_f64', 'store_f64x2', 'store_s16', 'store_s16x2', 'store_s32', 'store_s32x2', 'store_s64', 'store_s64x2', 'store_s8', 'store_s8x2', 'store_till_f32', 'store_till_f64', 'store_till_s32', 'store_till_s64', 'store_till_u32', 'store_till_u64', 'store_u16', 'store_u16x2', 'store_u32', 'store_u32x2', 'store_u64', 'store_u64x2', 'store_u8', 'store_u8x2', 'storea_f32', 'storea_f64', 'storea_s16', 'storea_s32', 'storea_s64', 'storea_s8', 'storea_u16', 'storea_u32', 'storea_u64', 'storea_u8', 'storeh_f32', 'storeh_f64', 'storeh_s16', 'storeh_s32', 'storeh_s64', 'storeh_s8', 'storeh_u16', 'storeh_u32', 'storeh_u64', 'storeh_u8', 'storel_f32', 'storel_f64', 'storel_s16', 'storel_s32', 'storel_s64', 'storel_s8', 'storel_u16', 'storel_u32', 'storel_u64', 'storel_u8', 'storen2_f32', 'storen2_f64', 'storen2_s32', 'storen2_s64', 'storen2_till_f32', 'storen2_till_f64', 'storen2_till_s32', 'storen2_till_s64', 'storen2_till_u32', 'storen2_till_u64', 'storen2_u32', 'storen2_u64', 'storen_f32', 'storen_f64', 'storen_s32', 'storen_s64', 'storen_till_f32', 'storen_till_f64', 'storen_till_s32', 'storen_till_s64', 'storen_till_u32', 'storen_till_u64', 'storen_u32', 'storen_u64', 'stores_f32', 'stores_f64', 'stores_s16', 'stores_s32', 'stores_s64', 'stores_s8', 'stores_u16', 'stores_u32', 'stores_u64', 'stores_u8', 'sub_f32', 'sub_f64', 'sub_s16', 'sub_s32', 'sub_s64', 'sub_s8', 'sub_u16', 'sub_u32', 'sub_u64', 'sub_u8', 'subs_s16', 'subs_s8', 'subs_u16', 'subs_u8', 'sum_f32', 'sum_f64', 'sum_u32', 'sum_u64', 'sumup_u16', 'sumup_u8', 'tobits_b16', 'tobits_b32', 'tobits_b64', 'tobits_b8', 'trunc_f32', 'trunc_f64', 'unzip_f32', 'unzip_f64', 'unzip_s16', 'unzip_s32', 'unzip_s64', 'unzip_s8', 'unzip_u16', 'unzip_u32', 'unzip_u64', 'unzip_u8', 'vector_type', 'xnor_b8', 'xor_b16', 'xor_b32', 'xor_b64', 'xor_b8', 'xor_f32', 'xor_f64', 'xor_s16', 'xor_s32', 'xor_s64', 'xor_s8', 'xor_u16', 'xor_u32', 'xor_u64', 'xor_u8', 'zero_f32', 'zero_f64', 'zero_s16', 'zero_s32', 'zero_s64', 'zero_s8', 'zero_u16', 'zero_u32', 'zero_u64', 'zero_u8', 'zip_f32', 'zip_f64', 'zip_s16', 'zip_s32', 'zip_s64', 'zip_s8', 'zip_u16', 'zip_u32', 'zip_u64', 'zip_u8']
>>> len(_)
829

And on top of that, stubgen isn't able to import these...
So ignoring them is probably for the best.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions