File tree 2 files changed +5
-1
lines changed
numpy/core/src/multiarray
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,9 @@ def setup(self, dtype):
165
165
def time_packbits (self , dtype ):
166
166
np .packbits (self .d )
167
167
168
+ def time_packbits_little (self , dtype ):
169
+ np .packbits (self .d , bitorder = "little" )
170
+
168
171
def time_packbits_axis0 (self , dtype ):
169
172
np .packbits (self .d2 , axis = 0 )
170
173
Original file line number Diff line number Diff line change @@ -1502,6 +1502,7 @@ pack_inner(const char *inptr,
1502
1502
npy_intp vn_out = n_out - (remain ? 1 : 0 );
1503
1503
const int vstep = npyv_nlanes_u64 ;
1504
1504
const int vstepx4 = vstep * 4 ;
1505
+ const int isAligned = npy_is_aligned (outptr , sizeof (npy_uint64 ));
1505
1506
vn_out -= (vn_out & (vstep - 1 ));
1506
1507
for (; index <= vn_out - vstepx4 ; index += vstepx4 , inptr += npyv_nlanes_u8 * 4 ) {
1507
1508
npyv_u8 v0 = npyv_load_u8 ((const npy_uint8 * )inptr );
@@ -1520,7 +1521,7 @@ pack_inner(const char *inptr,
1520
1521
bb [2 ] = npyv_tobits_b8 (npyv_cmpneq_u8 (v2 , v_zero ));
1521
1522
bb [3 ] = npyv_tobits_b8 (npyv_cmpneq_u8 (v3 , v_zero ));
1522
1523
if (out_stride == 1 &&
1523
- (!NPY_STRONG_ALIGNMENT || npy_is_aligned ( outptr , sizeof ( npy_uint64 )) )) {
1524
+ (!NPY_STRONG_ALIGNMENT || isAligned )) {
1524
1525
npy_uint64 * ptr64 = (npy_uint64 * )outptr ;
1525
1526
#if NPY_SIMD_WIDTH == 16
1526
1527
npy_uint64 bcomp = bb [0 ] | (bb [1 ] << 16 ) | (bb [2 ] << 32 ) | (bb [3 ] << 48 );
You can’t perform that action at this time.
0 commit comments