* 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). */
| 95 | * (BLAS won't handle negative or zero strides the way we want). |
| 96 | */ |
| 97 | static inline CBLAS_INT |
| 98 | blas_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. |
no outgoing calls
no test coverage detected