module documentation

Undocumented

Constant C99​_COMPLEX​_FUNCS Undocumented
Constant C99​_COMPLEX​_TYPES Undocumented
Constant C99​_FUNCS Undocumented
Constant C99​_FUNCS​_EXTENDED Undocumented
Constant C99​_FUNCS​_SINGLE Undocumented
Constant C​_ABI​_VERSION Undocumented
Constant C​_API​_VERSION Undocumented
Constant LONG​_DOUBLE​_REPRESENTATION​_SRC Undocumented
Constant MANDATORY​_FUNCS Undocumented
Constant OPTIONAL​_FUNCTION​_ATTRIBUTES Undocumented
Constant OPTIONAL​_FUNCTION​_ATTRIBUTES​_WITH​_INTRINSICS Undocumented
Constant OPTIONAL​_HEADERS Undocumented
Constant OPTIONAL​_INTRINSICS Undocumented
Constant OPTIONAL​_STDFUNCS Undocumented
Constant OPTIONAL​_STDFUNCS​_MAYBE Undocumented
Constant OPTIONAL​_VARIABLE​_ATTRIBUTES Undocumented
Class ​Mismatch​CAPIWarning Undocumented
Function check​_api​_version Emits a MismatchCAPIWarning if the C API version needs updating.
Function check​_for​_right​_shift​_internal​_compiler​_error On our arm CI, this fails with an internal compilation error
Function check​_long​_double​_representation Undocumented
Function fname2def Undocumented
Function get​_api​_versions Return current C API checksum and the recorded checksum.
Function is​_released Return True if a released version of numpy is detected.
Function long​_double​_representation Given a binary dump as given by GNU od -b, look for long double representation.
Function pyod Python implementation of the od UNIX utility (od -b, more exactly).
Function sym2def Undocumented
Function type2def Undocumented
Constant ​_AFTER​_SEQ Undocumented
Constant ​_BEFORE​_SEQ Undocumented
Constant ​_IBM​_DOUBLE​_DOUBLE​_BE Undocumented
Constant ​_IBM​_DOUBLE​_DOUBLE​_LE Undocumented
Constant ​_IEEE​_DOUBLE​_BE Undocumented
Constant ​_IEEE​_DOUBLE​_LE Undocumented
Constant ​_IEEE​_QUAD​_PREC​_BE Undocumented
Constant ​_IEEE​_QUAD​_PREC​_LE Undocumented
Constant ​_INTEL​_EXTENDED​_12B Undocumented
Constant ​_INTEL​_EXTENDED​_16B Undocumented
Constant ​_MOTOROLA​_EXTENDED​_12B Undocumented
C99_COMPLEX_FUNCS: list[str] =

Undocumented

Value
['cabs',
 'cacos',
 'cacosh',
 'carg',
 'casin',
 'casinh',
 'catan',
...
C99_COMPLEX_TYPES: list[str] =

Undocumented

Value
['complex double', 'complex float', 'complex long double']
C99_FUNCS: list[str] =

Undocumented

Value
['sin',
 'cos',
 'tan',
 'sinh',
 'cosh',
 'tanh',
 'fabs',
...
C99_FUNCS_EXTENDED =

Undocumented

Value
[(f + 'l') for f in C99_FUNCS]
C99_FUNCS_SINGLE =

Undocumented

Value
[(f + 'f') for f in C99_FUNCS]
C_ABI_VERSION: int =

Undocumented

Value
16777225
C_API_VERSION: int =

Undocumented

Value
15
LONG_DOUBLE_REPRESENTATION_SRC: str =

Undocumented

Value
'''
/* "before" is 16 bytes to ensure there\'s no padding between it and "x".
 *    We\'re not expecting any "long double" bigger than 16 bytes or with
 *       alignment requirements stricter than 16 bytes.  */
typedef %(type)s test_type;

struct {
...
MANDATORY_FUNCS: list[str] =

Undocumented

Value
['sin',
 'cos',
 'tan',
 'sinh',
 'cosh',
 'tanh',
 'fabs',
...
OPTIONAL_FUNCTION_ATTRIBUTES: list =

Undocumented

Value
[('__attribute__((optimize("unroll-loops")))',
  'attribute_optimize_unroll_loops'),
 ('__attribute__((optimize("O3")))', 'attribute_optimize_opt_3'),
 ('__attribute__((nonnull (1)))', 'attribute_nonnull'),
 ('__attribute__((target ("avx")))', 'attribute_target_avx'),
 ('__attribute__((target ("avx2")))', 'attribute_target_avx2'),
 ('__attribute__((target ("avx512f")))', 'attribute_target_avx512f'),
...
OPTIONAL_FUNCTION_ATTRIBUTES_WITH_INTRINSICS: list =

Undocumented

Value
[('__attribute__((target("avx2,fma")))',
  'attribute_target_avx2_with_intrinsics',
  '__m256 temp = _mm256_set1_ps(1.0); temp =                                 _mm
256_fmadd_ps(temp, temp, temp)',
  'immintrin.h'),
 ('__attribute__((target("avx512f")))',
  'attribute_target_avx512f_with_intrinsics',
...
OPTIONAL_HEADERS: list[str] =

Undocumented

Value
['xmmintrin.h',
 'emmintrin.h',
 'immintrin.h',
 'features.h',
 'xlocale.h',
 'dlfcn.h',
 'sys/mman.h']
OPTIONAL_INTRINSICS: list =

Undocumented

Value
[('__builtin_isnan', '5.'),
 ('__builtin_isinf', '5.'),
 ('__builtin_isfinite', '5.'),
 ('__builtin_bswap32', '5u'),
 ('__builtin_bswap64', '5u'),
 ('__builtin_expect', '5, 0'),
 ('__builtin_mul_overflow', '5, 5, (int*)5'),
...
OPTIONAL_STDFUNCS: list[str] =

Undocumented

Value
['expm1',
 'log1p',
 'acosh',
 'asinh',
 'atanh',
 'rint',
 'trunc',
...
OPTIONAL_STDFUNCS_MAYBE: list[str] =

Undocumented

Value
['expm1',
 'log1p',
 'acosh',
 'atanh',
 'asinh',
 'hypot',
 'copysign',
...
OPTIONAL_VARIABLE_ATTRIBUTES: list[str] =

Undocumented

Value
['__thread', '__declspec(thread)']
def check_api_version(apiversion, codegen_dir):
Emits a MismatchCAPIWarning if the C API version needs updating.
def check_for_right_shift_internal_compiler_error(cmd):

On our arm CI, this fails with an internal compilation error

The failure looks like the following, and can be reproduced on ARM64 GCC 5.4:

<source>: In function 'right_shift': <source>:4:20: internal compiler error: in expand_shift_1, at expmed.c:2349

ip1[i] = ip1[i] >> in2;
^

Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Compiler returned: 1

This function returns True if this compiler bug is present, and we need to turn off optimization for the function

def check_long_double_representation(cmd):

Undocumented

def fname2def(name):

Undocumented

def get_api_versions(apiversion, codegen_dir):

Return current C API checksum and the recorded checksum.

Return current C API checksum and the recorded checksum for the given version of the C API version.

def is_released(config):
Return True if a released version of numpy is detected.
def long_double_representation(lines):
Given a binary dump as given by GNU od -b, look for long double representation.
def pyod(filename):

Python implementation of the od UNIX utility (od -b, more exactly).

Parameters

filename : str
name of the file to get the dump from.

Returns

out : seq
list of lines of od output

Notes

We only implement enough to get the necessary information for long double representation, this is not intended as a compatible replacement for od.

def sym2def(symbol):

Undocumented

def type2def(symbol):

Undocumented

_AFTER_SEQ: list[str] =

Undocumented

Value
['376', '334', '272', '230', '166', '124', '062', '020']
_BEFORE_SEQ: list[str] =

Undocumented

Value
['000',
 '000',
 '000',
 '000',
 '000',
 '000',
 '000',
...
_IBM_DOUBLE_DOUBLE_BE =

Undocumented

Value
['301', '235', '157', '064', '124', '000', '000', '000']+['000']*8
_IBM_DOUBLE_DOUBLE_LE =

Undocumented

Value
['000', '000', '000', '124', '064', '157', '235', '301']+['000']*8
_IEEE_DOUBLE_BE: list[str] =

Undocumented

Value
['301', '235', '157', '064', '124', '000', '000', '000']
_IEEE_DOUBLE_LE =

Undocumented

Value
_IEEE_DOUBLE_BE[::-1]
_IEEE_QUAD_PREC_BE: list[str] =

Undocumented

Value
['300',
 '031',
 '326',
 '363',
 '105',
 '100',
 '000',
...
_IEEE_QUAD_PREC_LE =

Undocumented

Value
_IEEE_QUAD_PREC_BE[::-1]
_INTEL_EXTENDED_12B: list[str] =

Undocumented

Value
['000',
 '000',
 '000',
 '000',
 '240',
 '242',
 '171',
...
_INTEL_EXTENDED_16B: list[str] =

Undocumented

Value
['000',
 '000',
 '000',
 '000',
 '240',
 '242',
 '171',
...
_MOTOROLA_EXTENDED_12B: list[str] =

Undocumented

Value
['300',
 '031',
 '000',
 '000',
 '353',
 '171',
 '242',
...