MCPcopy Create free account
hub / github.com/numpy/numpy / blas_stride

Function blas_stride

numpy/core/src/common/npy_cblas.h:97–111  ·  view source on GitHub ↗

* Convert NumPy stride to BLAS stride. Returns 0 if conversion cannot be done * (BLAS won't handle negative or zero strides the way we want). */

Source from the content-addressed store, hash-verified

95 * (BLAS won't handle negative or zero strides the way we want).
96 */
97static inline CBLAS_INT
98blas_stride(npy_intp stride, unsigned itemsize)
99{
100 /*
101 * Should probably check pointer alignment also, but this may cause
102 * problems if we require complex to be 16 byte aligned.
103 */
104 if (stride > 0 && (stride % itemsize) == 0) {
105 stride /= itemsize;
106 if (stride <= CBLAS_INT_MAX) {
107 return stride;
108 }
109 }
110 return 0;
111}
112
113/*
114 * Define a chunksize for CBLAS.

Callers 2

CFLOAT_vdotFunction · 0.85
CDOUBLE_vdotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected