numpy 2.0.0
|
#include "Python.h"
#include "structmember.h"
#include <numpy/ndarrayobject.h>
#include <numpy/npy_cpu.h>
#include <numpy/halffloat.h>
#include "lowlevel_strided_loops.h"
Defines | |
#define | PY_SSIZE_T_CLEAN |
#define | NPY_NO_DEPRECATED_API |
#define | _MULTIARRAYMODULE |
#define | NPY_USE_UNALIGNED_ACCESS 0 |
#define | _NPY_NOP1(x) (x) |
#define | _NPY_NOP2(x) (x) |
#define | _NPY_NOP4(x) (x) |
#define | _NPY_NOP8(x) (x) |
#define | _NPY_SWAP2(x) |
#define | _NPY_SWAP4(x) |
#define | _NPY_SWAP_PAIR4(x) |
#define | _NPY_SWAP8(x) |
#define | _NPY_SWAP_PAIR8(x) |
#define | _NPY_SWAP_INPLACE2(x) |
#define | _NPY_SWAP_INPLACE4(x) |
#define | _NPY_SWAP_INPLACE8(x) |
#define | _NPY_SWAP_INPLACE16(x) |
Functions | |
static void | _strided_to_strided (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *NPY_UNUSED(data)) |
static void | _swap_strided_to_strided (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *NPY_UNUSED(data)) |
static void | _swap_pair_strided_to_strided (char *dst, npy_intp dst_stride, char *src, npy_intp src_stride, npy_intp N, npy_intp src_itemsize, NpyAuxData *NPY_UNUSED(data)) |
static void | _contig_to_contig (char *dst, npy_intp NPY_UNUSED(dst_stride), char *src, npy_intp NPY_UNUSED(src_stride), npy_intp N, npy_intp src_itemsize, NpyAuxData *NPY_UNUSED(data)) |
NPY_NO_EXPORT PyArray_StridedTransferFn * | PyArray_GetStridedCopyFn (int aligned, npy_intp src_stride, npy_intp dst_stride, npy_intp itemsize) |
NPY_NO_EXPORT PyArray_StridedTransferFn * | function (int aligned, npy_intp src_stride, npy_intp dst_stride, npy_intp itemsize) |
NPY_NO_EXPORT PyArray_StridedTransferFn * | PyArray_GetStridedNumericCastFn (int aligned, npy_intp src_stride, npy_intp dst_stride, int src_type_num, int dst_type_num) |
NPY_NO_EXPORT npy_intp | PyArray_TransferNDimToStrided (npy_intp ndim, char *dst, npy_intp dst_stride, char *src, npy_intp *src_strides, npy_intp src_strides_inc, npy_intp *coords, npy_intp coords_inc, npy_intp *shape, npy_intp shape_inc, npy_intp count, npy_intp src_itemsize, PyArray_StridedTransferFn *stransfer, NpyAuxData *data) |
NPY_NO_EXPORT npy_intp | PyArray_TransferStridedToNDim (npy_intp ndim, char *dst, npy_intp *dst_strides, npy_intp dst_strides_inc, char *src, npy_intp src_stride, npy_intp *coords, npy_intp coords_inc, npy_intp *shape, npy_intp shape_inc, npy_intp count, npy_intp src_itemsize, PyArray_StridedTransferFn *stransfer, NpyAuxData *data) |
NPY_NO_EXPORT npy_intp | PyArray_TransferMaskedStridedToNDim (npy_intp ndim, char *dst, npy_intp *dst_strides, npy_intp dst_strides_inc, char *src, npy_intp src_stride, npy_uint8 *mask, npy_intp mask_stride, npy_intp *coords, npy_intp coords_inc, npy_intp *shape, npy_intp shape_inc, npy_intp count, npy_intp src_itemsize, PyArray_MaskedStridedTransferFn *stransfer, NpyAuxData *data) |
#define _MULTIARRAYMODULE |
#define _NPY_NOP1 | ( | x | ) | (x) |
#define _NPY_NOP2 | ( | x | ) | (x) |
#define _NPY_NOP4 | ( | x | ) | (x) |
#define _NPY_NOP8 | ( | x | ) | (x) |
#define _NPY_SWAP2 | ( | x | ) |
(((((npy_uint16)x)&0xffu) << 8) | \ (((npy_uint16)x) >> 8))
#define _NPY_SWAP4 | ( | x | ) |
(((((npy_uint32)x)&0xffu) << 24) | \ ((((npy_uint32)x)&0xff00u) << 8) | \ ((((npy_uint32)x)&0xff0000u) >> 8) | \ (((npy_uint32)x) >> 24))
#define _NPY_SWAP8 | ( | x | ) |
(((((npy_uint64)x)&0xffULL) << 56) | \ ((((npy_uint64)x)&0xff00ULL) << 40) | \ ((((npy_uint64)x)&0xff0000ULL) << 24) | \ ((((npy_uint64)x)&0xff000000ULL) << 8) | \ ((((npy_uint64)x)&0xff00000000ULL) >> 8) | \ ((((npy_uint64)x)&0xff0000000000ULL) >> 24) | \ ((((npy_uint64)x)&0xff000000000000ULL) >> 40) | \ (((npy_uint64)x) >> 56))
#define _NPY_SWAP_INPLACE16 | ( | x | ) |
{ \
char a = (x)[0]; (x)[0] = (x)[15]; (x)[15] = a; \
a = (x)[1]; (x)[1] = (x)[14]; (x)[14] = a; \
a = (x)[2]; (x)[2] = (x)[13]; (x)[13] = a; \
a = (x)[3]; (x)[3] = (x)[12]; (x)[12] = a; \
a = (x)[4]; (x)[4] = (x)[11]; (x)[11] = a; \
a = (x)[5]; (x)[5] = (x)[10]; (x)[10] = a; \
a = (x)[6]; (x)[6] = (x)[9]; (x)[9] = a; \
a = (x)[7]; (x)[7] = (x)[8]; (x)[8] = a; \
}
#define _NPY_SWAP_INPLACE2 | ( | x | ) |
{ \
char a = (x)[0]; (x)[0] = (x)[1]; (x)[1] = a; \
}
#define _NPY_SWAP_INPLACE4 | ( | x | ) |
{ \
char a = (x)[0]; (x)[0] = (x)[3]; (x)[3] = a; \
a = (x)[1]; (x)[1] = (x)[2]; (x)[2] = a; \
}
#define _NPY_SWAP_INPLACE8 | ( | x | ) |
{ \
char a = (x)[0]; (x)[0] = (x)[7]; (x)[7] = a; \
a = (x)[1]; (x)[1] = (x)[6]; (x)[6] = a; \
a = (x)[2]; (x)[2] = (x)[5]; (x)[5] = a; \
a = (x)[3]; (x)[3] = (x)[4]; (x)[4] = a; \
}
#define _NPY_SWAP_PAIR4 | ( | x | ) |
(((((npy_uint32)x)&0xffu) << 8) | \ ((((npy_uint32)x)&0xff00u) >> 8) | \ ((((npy_uint32)x)&0xff0000u) << 8) | \ ((((npy_uint32)x)&0xff000000u) >> 8))
#define _NPY_SWAP_PAIR8 | ( | x | ) |
(((((npy_uint64)x)&0xffULL) << 24) | \ ((((npy_uint64)x)&0xff00ULL) << 8) | \ ((((npy_uint64)x)&0xff0000ULL) >> 8) | \ ((((npy_uint64)x)&0xff000000ULL) >> 24) | \ ((((npy_uint64)x)&0xff00000000ULL) << 24) | \ ((((npy_uint64)x)&0xff0000000000ULL) << 8) | \ ((((npy_uint64)x)&0xff000000000000ULL) >> 8) | \ ((((npy_uint64)x)&0xff00000000000000ULL) >> 24))
#define NPY_NO_DEPRECATED_API |
#define NPY_USE_UNALIGNED_ACCESS 0 |
#define PY_SSIZE_T_CLEAN |
static void _contig_to_contig | ( | char * | dst, |
npy_intp | NPY_UNUSEDdst_stride, | ||
char * | src, | ||
npy_intp | NPY_UNUSEDsrc_stride, | ||
npy_intp | N, | ||
npy_intp | src_itemsize, | ||
NpyAuxData * | NPY_UNUSEDdata | ||
) | [static] |
static void _strided_to_strided | ( | char * | dst, |
npy_intp | dst_stride, | ||
char * | src, | ||
npy_intp | src_stride, | ||
npy_intp | N, | ||
npy_intp | src_itemsize, | ||
NpyAuxData * | NPY_UNUSEDdata | ||
) | [static] |
#src_contig = 0, 0, 1 ,1# #dst_contig = 0, 1, 0 ,1#
#prefix = , _aligned, _swap, _aligned_swap, _swap_pair, _aligned_swap_pair# #is_aligned = 0, 1, 0, 1, 0, 1# #minelsize = 1, 1, 2, 2, 4, 4# #is_swap = 0, 0, 1, 1, 2, 2#
<
References c.
static void _swap_pair_strided_to_strided | ( | char * | dst, |
npy_intp | dst_stride, | ||
char * | src, | ||
npy_intp | src_stride, | ||
npy_intp | N, | ||
npy_intp | src_itemsize, | ||
NpyAuxData * | NPY_UNUSEDdata | ||
) | [static] |
static void _swap_strided_to_strided | ( | char * | dst, |
npy_intp | dst_stride, | ||
char * | src, | ||
npy_intp | src_stride, | ||
npy_intp | N, | ||
npy_intp | src_itemsize, | ||
NpyAuxData * | NPY_UNUSEDdata | ||
) | [static] |
NPY_NO_EXPORT PyArray_StridedTransferFn* function | ( | int | aligned, |
npy_intp | src_stride, | ||
npy_intp | dst_stride, | ||
npy_intp | itemsize | ||
) |
<
Referenced by ufunc_frompyfunc().
NPY_NO_EXPORT PyArray_StridedTransferFn* PyArray_GetStridedCopyFn | ( | int | aligned, |
npy_intp | src_stride, | ||
npy_intp | dst_stride, | ||
npy_intp | itemsize | ||
) |
<
Referenced by _null_to_strided_set_bool_one().
NPY_NO_EXPORT PyArray_StridedTransferFn* PyArray_GetStridedNumericCastFn | ( | int | aligned, |
npy_intp | src_stride, | ||
npy_intp | dst_stride, | ||
int | src_type_num, | ||
int | dst_type_num | ||
) |
</blockquote>
</blockquote>
NPY_NO_EXPORT npy_intp PyArray_TransferMaskedStridedToNDim | ( | npy_intp | ndim, |
char * | dst, | ||
npy_intp * | dst_strides, | ||
npy_intp | dst_strides_inc, | ||
char * | src, | ||
npy_intp | src_stride, | ||
npy_uint8 * | mask, | ||
npy_intp | mask_stride, | ||
npy_intp * | coords, | ||
npy_intp | coords_inc, | ||
npy_intp * | shape, | ||
npy_intp | shape_inc, | ||
npy_intp | count, | ||
npy_intp | src_itemsize, | ||
PyArray_MaskedStridedTransferFn * | stransfer, | ||
NpyAuxData * | data | ||
) |
Referenced by npyiter_coalesce_axes().
NPY_NO_EXPORT npy_intp PyArray_TransferNDimToStrided | ( | npy_intp | ndim, |
char * | dst, | ||
npy_intp | dst_stride, | ||
char * | src, | ||
npy_intp * | src_strides, | ||
npy_intp | src_strides_inc, | ||
npy_intp * | coords, | ||
npy_intp | coords_inc, | ||
npy_intp * | shape, | ||
npy_intp | shape_inc, | ||
npy_intp | count, | ||
npy_intp | src_itemsize, | ||
PyArray_StridedTransferFn * | stransfer, | ||
NpyAuxData * | data | ||
) |
NPY_NO_EXPORT npy_intp PyArray_TransferStridedToNDim | ( | npy_intp | ndim, |
char * | dst, | ||
npy_intp * | dst_strides, | ||
npy_intp | dst_strides_inc, | ||
char * | src, | ||
npy_intp | src_stride, | ||
npy_intp * | coords, | ||
npy_intp | coords_inc, | ||
npy_intp * | shape, | ||
npy_intp | shape_inc, | ||
npy_intp | count, | ||
npy_intp | src_itemsize, | ||
PyArray_StridedTransferFn * | stransfer, | ||
NpyAuxData * | data | ||
) |