numpy  2.0.0
src/multiarray/arraytypes.h File Reference
#include "common.h"

Go to the source code of this file.

Functions

NPY_NO_EXPORT int set_typeinfo (PyObject *dict)
NPY_NO_EXPORT void FLOAT_dot (char *, npy_intp, char *, npy_intp, char *, npy_intp, void *)
NPY_NO_EXPORT void CFLOAT_dot (char *, npy_intp, char *, npy_intp, char *, npy_intp, void *)
NPY_NO_EXPORT void DOUBLE_dot (char *, npy_intp, char *, npy_intp, char *, npy_intp, void *)
NPY_NO_EXPORT void CDOUBLE_dot (char *, npy_intp, char *, npy_intp, char *, npy_intp, void *)
NPY_NO_EXPORT int small_correlate (const char *d_, npy_intp dstride, npy_intp nd, enum NPY_TYPES dtype, const char *k_, npy_intp kstride, npy_intp nk, enum NPY_TYPES ktype, char *out_, npy_intp ostride)

Variables

NPY_NO_EXPORT PyArray_Descr LONGLONG_Descr
NPY_NO_EXPORT PyArray_Descr LONG_Descr
NPY_NO_EXPORT PyArray_Descr INT_Descr

Function Documentation

NPY_NO_EXPORT void CDOUBLE_dot ( char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
void *   
)

Referenced by blas_dot().

NPY_NO_EXPORT void CFLOAT_dot ( char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
void *   
)

Referenced by blas_dot().

NPY_NO_EXPORT void DOUBLE_dot ( char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
void *   
)

Referenced by blas_dot().

NPY_NO_EXPORT void FLOAT_dot ( char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
char *  ,
npy_intp  ,
void *   
)
needed for blasfuncs

Referenced by blas_dot().

NPY_NO_EXPORT int set_typeinfo ( PyObject *  dict)

* SETUP TYPE INFO **

This function is called during numpy module initialization, and is used to initialize internal dtype tables.
Add cast functions for the new types
begin repeat <blockquote>

#name1 = BOOL,
BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID, DATETIME,TIMEDELTA#

</blockquote>

begin repeat1 <blockquote> #name2 = HALF, DATETIME, TIMEDELTA#</blockquote>
end repeat1*
end repeat*
begin repeat <blockquote>

name = BOOL,
BYTE, UBYTE, SHORT, USHORT, INT, UINT, INTP, UINTP, LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID, DATETIME,TIMEDELTA#

</blockquote>

end repeat*
begin repeat
name = BOOL,
BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID, DATETIME, TIMEDELTA#
end repeat*
Set a dictionary with type information
begin repeat <blockquote>

name = BOOL,
BYTE, UBYTE, SHORT, USHORT, INT, UINT, INTP, UINTP, LONG, ULONG, LONGLONG, ULONGLONG#
#uname = BOOL,
BYTE*2, SHORT*2, INT*2, INTP*2, LONG*2, LONGLONG*2#
#Name = Bool,
Byte, UByte, Short, UShort, Int, UInt, Intp, UIntp, Long, ULong, LongLong, ULongLong#
#type = npy_bool,
npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint, npy_intp, npy_uintp, npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#max= 1,
NPY_MAX_BYTE, NPY_MAX_UBYTE, NPY_MAX_SHORT, NPY_MAX_USHORT, NPY_MAX_INT, PyLong_FromUnsignedLong(NPY_MAX_UINT), PyLong_FromLongLong((npy_longlong) NPY_MAX_INTP), PyLong_FromUnsignedLongLong((npy_ulonglong) NPY_MAX_UINTP), NPY_MAX_LONG, PyLong_FromUnsignedLong((npy_ulong) NPY_MAX_ULONG), PyLong_FromLongLong((npy_longlong) NPY_MAX_LONGLONG), PyLong_FromUnsignedLongLong((npy_ulonglong) NPY_MAX_ULONGLONG)#
#min = 0, NPY_MIN_BYTE, 0, NPY_MIN_SHORT, 0, NPY_MIN_INT, 0,
PyLong_FromLongLong((npy_longlong) NPY_MIN_INTP), 0, NPY_MIN_LONG, 0, PyLong_FromLongLong((npy_longlong) NPY_MIN_LONGLONG), 0#
System Message: WARNING/2 (<string>, line 32) Definition list ends without a blank line; unexpected unindent.
#cx = i*6, N, N, N, l, N, N, N# #cn = i*7, N, i, l, i, N, i# </blockquote>
end repeat*
begin repeat <blockquote>

#type = npy_half, npy_float, npy_double, npy_longdouble,
npy_cfloat, npy_cdouble, npy_clongdouble#
name = HALF, FLOAT, DOUBLE, LONGDOUBLE,
CFLOAT, CDOUBLE, CLONGDOUBLE#
#Name = Half, Float, Double, LongDouble,
CFloat, CDouble, CLongDouble#
System Message: WARNING/2 (<string>, line 9) Definition list ends without a blank line; unexpected unindent.
#num = 1, 1, 1, 1, 2, 2, 2# </blockquote>
end repeat*
NPY_NO_EXPORT int small_correlate ( const char *  d_,
npy_intp  dstride,
npy_intp  nd,
enum NPY_TYPES  dtype,
const char *  k_,
npy_intp  kstride,
npy_intp  nk,
enum NPY_TYPES  ktype,
char *  out_,
npy_intp  ostride 
)
for _pyarray_correlate

* small correlate **

Compute correlation of data with with small kernels Calling a BLAS dot product for the inner loop of the correlation is overkill for small kernels. It is faster to compute it directly. Intended to be used by _pyarray_correlate so no input verifications is done especially it does not handle the boundaries, they should be handled by the caller. Returns 0 if kernel is considered too large or types are not supported, then the regular array dot should be used to process the data.

d_, dstride, nd, dtype: data pointer, its stride in bytes, number of
elements and type of data
k_, kstride, nk, ktype: kernel pointer, its stride in bytes, number of
elements and type of data
System Message: WARNING/2 (<string>, line 14) Definition list ends without a blank line; unexpected unindent.
out_, ostride: output data pointer and its stride in bytes

Docutils System Messages

System Message: ERROR/3 (<string>, line 10); backlink Unknown target name: "d".
System Message: ERROR/3 (<string>, line 12); backlink Unknown target name: "k".
System Message: ERROR/3 (<string>, line 14); backlink Unknown target name: "out".
only handle small kernels and uniform types
begin repeat
Float types
#type = npy_float, npy_double# TYPE = NPY_FLOAT, NPY_DOUBLE#
unroll inner loop to optimize register usage of the kernel
begin repeat1
#ksz_outer = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11#
begin repeat2
#ksz = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11#
load kernel
end repeat2*
begin repeat2
#ksz = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11#
end repeat2*
end repeat1*
end repeat*

References SETTYPE.


Variable Documentation