|
numpy
2.0.0
|
#include "lowlevel_strided_loops.h"#include "numpy/npy_common.h"#include "numpy/ufuncobject.h"#include "numpy/npy_math.h"#include <assert.h>#include <stdlib.h>#include <float.h>#include <string.h>Defines | |
| #define | __NPY_SIMD_INC |
| #define | IS_BLOCKABLE_UNARY(esize, vsize) |
| #define | IS_BLOCKABLE_REDUCE(esize, vsize) |
| #define | IS_BLOCKABLE_BINARY(esize, vsize) |
| #define | IS_BLOCKABLE_BINARY_SCALAR1(esize, vsize) |
| #define | IS_BLOCKABLE_BINARY_SCALAR2(esize, vsize) |
| #define | IS_BLOCKABLE_BINARY_BOOL(esize, vsize) |
| #define | IS_BLOCKABLE_BINARY_SCALAR1_BOOL(esize, vsize) |
| #define | IS_BLOCKABLE_BINARY_SCALAR2_BOOL(esize, vsize) |
| #define | LOOP_BLOCK_ALIGN_VAR(var, type, alignment) |
| #define | LOOP_BLOCKED(type, vsize) |
| #define | LOOP_BLOCKED_END for (; i < n; i++) |
Functions | |
| static NPY_INLINE npy_intp | abs_intp (npy_intp x) |
| static NPY_INLINE int run_ name _simd_ func _ | TYPE (char **args, npy_intp *dimensions, npy_intp *steps) |
| static NPY_INLINE int run_binary_simd_ kind | _BOOL (char **args, npy_intp *dimensions, npy_intp *steps) |
| #define __NPY_SIMD_INC |
| #define IS_BLOCKABLE_BINARY | ( | esize, | |
| vsize | |||
| ) |
(steps[0] == steps[1] && steps[1] == steps[2] && steps[2] == (esize) && \
npy_is_aligned(args[2], (esize)) && npy_is_aligned(args[1], (esize)) && \
npy_is_aligned(args[0], (esize)) && \
(abs_intp(args[2] - args[0]) >= (vsize) || \
abs_intp(args[2] - args[0]) == 0) && \
(abs_intp(args[2] - args[1]) >= (vsize) || \
abs_intp(args[2] - args[1]) >= 0))
Referenced by TYPE().
| #define IS_BLOCKABLE_BINARY_BOOL | ( | esize, | |
| vsize | |||
| ) |
(steps[0] == (esize) && steps[0] == steps[1] && steps[2] == (1) && \
npy_is_aligned(args[1], (esize)) && \
npy_is_aligned(args[0], (esize)))
| #define IS_BLOCKABLE_BINARY_SCALAR1 | ( | esize, | |
| vsize | |||
| ) |
(steps[0] == 0 && steps[1] == steps[2] && steps[2] == (esize) && \
npy_is_aligned(args[2], (esize)) && npy_is_aligned(args[1], (esize)) && \
((abs_intp(args[2] - args[1]) >= (vsize)) || \
(abs_intp(args[2] - args[1]) == 0)) && \
abs_intp(args[2] - args[0]) >= (esize))
Referenced by TYPE().
| #define IS_BLOCKABLE_BINARY_SCALAR1_BOOL | ( | esize, | |
| vsize | |||
| ) |
(steps[0] == 0 && steps[1] == (esize) && steps[2] == (1) && \
npy_is_aligned(args[1], (esize)))
| #define IS_BLOCKABLE_BINARY_SCALAR2 | ( | esize, | |
| vsize | |||
| ) |
(steps[1] == 0 && steps[0] == steps[2] && steps[2] == (esize) && \
npy_is_aligned(args[2], (esize)) && npy_is_aligned(args[0], (esize)) && \
((abs_intp(args[2] - args[0]) >= (vsize)) || \
(abs_intp(args[2] - args[0]) == 0)) && \
abs_intp(args[2] - args[1]) >= (esize))
Referenced by TYPE().
| #define IS_BLOCKABLE_BINARY_SCALAR2_BOOL | ( | esize, | |
| vsize | |||
| ) |
(steps[0] == (esize) && steps[1] == 0 && steps[2] == (1) && \
npy_is_aligned(args[0], (esize)))
| #define IS_BLOCKABLE_REDUCE | ( | esize, | |
| vsize | |||
| ) |
(steps[1] == (esize) && abs_intp(args[1] - args[0]) >= (vsize) && \ npy_is_aligned(args[1], (esize)) && \ npy_is_aligned(args[0], (esize)))
| #define IS_BLOCKABLE_UNARY | ( | esize, | |
| vsize | |||
| ) |
(steps[0] == (esize) && steps[0] == steps[1] && \
(npy_is_aligned(args[0], esize) && npy_is_aligned(args[1], esize)) && \
((abs_intp(args[1] - args[0]) >= (vsize)) || \
((abs_intp(args[1] - args[0]) == 0))))
| #define LOOP_BLOCK_ALIGN_VAR | ( | var, | |
| type, | |||
| alignment | |||
| ) |
npy_intp i, peel = npy_aligned_block_offset(var, sizeof(type),\ alignment, n);\ for(i = 0; i < peel; i++)
Referenced by _BOOL().
| #define LOOP_BLOCKED | ( | type, | |
| vsize | |||
| ) |
for(; i < npy_blocked_end(peel, sizeof(type), vsize, n);\ i += (vsize / sizeof(type)))
Referenced by _BOOL().
| #define LOOP_BLOCKED_END for (; i < n; i++) |
Referenced by _BOOL().
| static NPY_INLINE int run_unary_simd_ kind _BOOL | ( | char ** | args, |
| npy_intp * | dimensions, | ||
| npy_intp * | steps | ||
| ) | [static] |
References c, LOOP_BLOCK_ALIGN_VAR, LOOP_BLOCKED, LOOP_BLOCKED_END, npy_is_aligned(), and OP.
Referenced by PyUFunc_On_Om().
| static NPY_INLINE npy_intp abs_intp | ( | npy_intp | x | ) | [static] |
<
| static NPY_INLINE int run_ kind _simd_ TYPE | ( | char ** | args, |
| npy_intp * | dimensions, | ||
| npy_intp * | steps | ||
| ) | [static] |
#simd = 1, 1, 1, 1, 1, 1, 0, 0#
References dimensions, IS_BLOCKABLE_BINARY, IS_BLOCKABLE_BINARY_SCALAR1, IS_BLOCKABLE_BINARY_SCALAR2, and kind().