Skip to content

Commit 7647ccd

Browse files
committed
wip
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
1 parent 12fe78e commit 7647ccd

153 files changed

Lines changed: 921 additions & 58 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

encodings/alp/src/alp/array.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,12 @@ impl ALPArray {
459459
}
460460
}
461461

462+
#[inline]
462463
pub fn ptype(&self) -> PType {
463464
self.dtype.as_ptype()
464465
}
465466

467+
#[inline]
466468
pub fn encoded(&self) -> &ArrayRef {
467469
&self.encoded
468470
}
@@ -472,6 +474,7 @@ impl ALPArray {
472474
self.exponents
473475
}
474476

477+
#[inline]
475478
pub fn patches(&self) -> Option<&Patches> {
476479
self.patches.as_ref()
477480
}
@@ -484,6 +487,7 @@ impl ALPArray {
484487
}
485488

486489
impl ValidityChild<ALP> for ALP {
490+
#[inline]
487491
fn validity_child(array: &ALPArray) -> &ArrayRef {
488492
array.encoded()
489493
}

encodings/alp/src/alp/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub struct Exponents {
6767
}
6868

6969
impl Display for Exponents {
70+
#[inline]
7071
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
7172
write!(f, "e: {}, f: {}", self.e, self.f)
7273
}

encodings/alp/src/alp_rd/array.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,13 @@ impl ALPRDArray {
473473
///
474474
/// These are bit-packed and dictionary encoded, and cannot directly be interpreted without
475475
/// the metadata of this array.
476+
#[inline]
476477
pub fn left_parts(&self) -> &ArrayRef {
477478
&self.left_parts
478479
}
479480

480481
/// The rightmost (least significant) bits of the floating point values stored in the array.
482+
#[inline]
481483
pub fn right_parts(&self) -> &ArrayRef {
482484
&self.right_parts
483485
}
@@ -488,6 +490,7 @@ impl ALPRDArray {
488490
}
489491

490492
/// Patches of left-most bits.
493+
#[inline]
491494
pub fn left_parts_patches(&self) -> Option<&Patches> {
492495
self.left_parts_patches.as_ref()
493496
}
@@ -498,12 +501,14 @@ impl ALPRDArray {
498501
&self.left_parts_dictionary
499502
}
500503

504+
#[inline]
501505
pub fn replace_left_parts_patches(&mut self, patches: Option<Patches>) {
502506
self.left_parts_patches = patches;
503507
}
504508
}
505509

506510
impl ValidityChild<ALPRD> for ALPRD {
511+
#[inline]
507512
fn validity_child(array: &ALPRDArray) -> &ArrayRef {
508513
array.left_parts()
509514
}

encodings/bytebool/src/array.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,23 +244,27 @@ impl ByteBoolArray {
244244
Self::new(BufferHandle::new_host(ByteBuffer::from(data)), validity)
245245
}
246246

247+
#[inline]
247248
pub fn buffer(&self) -> &BufferHandle {
248249
&self.buffer
249250
}
250251

252+
#[inline]
251253
pub fn as_slice(&self) -> &[bool] {
252254
// Safety: The internal buffer contains byte-sized bools
253255
unsafe { std::mem::transmute(self.buffer().as_host().as_slice()) }
254256
}
255257
}
256258

257259
impl ValidityHelper for ByteBoolArray {
260+
#[inline]
258261
fn validity(&self) -> &Validity {
259262
&self.validity
260263
}
261264
}
262265

263266
impl OperationsVTable<ByteBool> for ByteBool {
267+
#[inline]
264268
fn scalar_at(array: &ByteBoolArray, index: usize) -> VortexResult<Scalar> {
265269
Ok(Scalar::bool(
266270
array.buffer.as_host()[index] == 1,
@@ -270,12 +274,14 @@ impl OperationsVTable<ByteBool> for ByteBool {
270274
}
271275

272276
impl From<Vec<bool>> for ByteBoolArray {
277+
#[inline]
273278
fn from(value: Vec<bool>) -> Self {
274279
Self::from_vec(value, Validity::AllValid)
275280
}
276281
}
277282

278283
impl From<Vec<Option<bool>>> for ByteBoolArray {
284+
#[inline]
279285
fn from(value: Vec<Option<bool>>) -> Self {
280286
let validity = Validity::from_iter(value.iter().map(|v| v.is_some()));
281287

encodings/datetime-parts/src/array.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ impl DateTimePartsArray {
325325
}
326326
}
327327

328+
#[inline]
328329
pub fn into_parts(self) -> DateTimePartsArrayParts {
329330
DateTimePartsArrayParts {
330331
dtype: self.dtype,
@@ -334,20 +335,24 @@ impl DateTimePartsArray {
334335
}
335336
}
336337

338+
#[inline]
337339
pub fn days(&self) -> &ArrayRef {
338340
&self.days
339341
}
340342

343+
#[inline]
341344
pub fn seconds(&self) -> &ArrayRef {
342345
&self.seconds
343346
}
344347

348+
#[inline]
345349
pub fn subseconds(&self) -> &ArrayRef {
346350
&self.subseconds
347351
}
348352
}
349353

350354
impl ValidityChild<DateTimeParts> for DateTimeParts {
355+
#[inline]
351356
fn validity_child(array: &DateTimePartsArray) -> &ArrayRef {
352357
array.days()
353358
}

encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,15 @@ impl DecimalBytePartsArray {
252252
}
253253

254254
/// If `_lower_parts` is supported check all calls use this correctly.
255+
#[inline]
255256
pub fn into_parts(self) -> DecimalBytePartsArrayParts {
256257
DecimalBytePartsArrayParts {
257258
msp: self.msp,
258259
dtype: self.dtype,
259260
}
260261
}
261262

263+
#[inline]
262264
pub fn decimal_dtype(&self) -> &DecimalDType {
263265
self.dtype
264266
.as_decimal_opt()
@@ -302,6 +304,7 @@ fn to_canonical_decimal(
302304
}
303305

304306
impl OperationsVTable<DecimalByteParts> for DecimalByteParts {
307+
#[inline]
305308
fn scalar_at(array: &DecimalBytePartsArray, index: usize) -> VortexResult<Scalar> {
306309
// TODO(joe): support parts len != 1
307310
let scalar = array.msp.scalar_at(index)?;
@@ -318,6 +321,7 @@ impl OperationsVTable<DecimalByteParts> for DecimalByteParts {
318321
}
319322

320323
impl ValidityChild<DecimalByteParts> for DecimalByteParts {
324+
#[inline]
321325
fn validity_child(array: &DecimalBytePartsArray) -> &ArrayRef {
322326
// validity stored in 0th child
323327
&array.msp

encodings/fastlanes/src/bit_transpose/aarch64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ static SCATTER_8X8_NEON: [[u8; 16]; 4] = [
114114

115115
/// Perform 8x8 bit transpose on two u64s packed in a `uint64x2_t`.
116116
#[allow(unsafe_op_in_unsafe_fn)]
117-
#[inline]
118117
unsafe fn bit_transpose_8x8_neon(mut v: uint64x2_t) -> uint64x2_t {
119118
let mask1 = vdupq_n_u64(TRANSPOSE_2X2);
120119
let t = vandq_u64(veorq_u64(v, vshrq_n_u64::<7>(v)), mask1);

encodings/fastlanes/src/bit_transpose/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const TRANSPOSE_4X4: u64 = 0x0000_CCCC_0000_CCCC;
4040
const TRANSPOSE_8X8: u64 = 0x0000_0000_F0F0_F0F0;
4141

4242
/// Dispatch to the best available implementation at runtime.
43-
#[inline]
4443
pub fn transpose_bits(input: &[u8; 128], output: &mut [u8; 128]) {
4544
#[cfg(target_arch = "x86_64")]
4645
{
@@ -65,7 +64,6 @@ pub fn transpose_bits(input: &[u8; 128], output: &mut [u8; 128]) {
6564
}
6665

6766
/// Dispatch untranspose to the best available implementation at runtime.
68-
#[inline]
6967
pub fn untranspose_bits(input: &[u8; 128], output: &mut [u8; 128]) {
7068
#[cfg(target_arch = "x86_64")]
7169
{

encodings/fastlanes/src/bit_transpose/scalar.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use crate::bit_transpose::TRANSPOSE_8X8;
1515
#[allow(dead_code)]
1616
pub fn transpose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
1717
// Helper to perform 8x8 bit transpose on a u64 (each byte becomes a row)
18-
#[inline]
1918
fn transpose_8x8(mut x: u64) -> u64 {
2019
// Step 1: Transpose 2x2 bit blocks
2120
let t = (x ^ (x >> 7)) & TRANSPOSE_2X2;
@@ -29,7 +28,6 @@ pub fn transpose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
2928
}
3029

3130
// Helper to gather 8 bytes at stride 16 into a u64
32-
#[inline]
3331
fn gather(input: &[u8; 128], base: usize) -> u64 {
3432
u64::from(input[base])
3533
| (u64::from(input[base + 16]) << 8)
@@ -89,7 +87,6 @@ pub fn transpose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
8987
#[inline(never)]
9088
#[allow(dead_code)]
9189
pub fn untranspose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
92-
#[inline]
9390
fn transpose_8x8(mut x: u64) -> u64 {
9491
let t = (x ^ (x >> 7)) & TRANSPOSE_2X2;
9592
x = x ^ t ^ (t << 7);
@@ -99,7 +96,6 @@ pub fn untranspose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
9996
x ^ t ^ (t << 28)
10097
}
10198

102-
#[inline]
10399
fn gather_transposed(input: &[u8; 128], base_group: usize, offset: usize) -> u64 {
104100
let mut result: u64 = 0;
105101
for bit_pos in 0..8 {
@@ -108,7 +104,6 @@ pub fn untranspose_bits_scalar(input: &[u8; 128], output: &mut [u8; 128]) {
108104
result
109105
}
110106

111-
#[inline]
112107
fn scatter(output: &mut [u8; 128], base: usize, val: u64) {
113108
output[base] = val as u8;
114109
output[base + 16] = (val >> 8) as u8;

encodings/fastlanes/src/bit_transpose/x86.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub fn has_vbmi() -> bool {
4949
#[allow(unsafe_op_in_unsafe_fn)]
5050
pub unsafe fn transpose_bits_bmi2(input: &[u8; 128], output: &mut [u8; 128]) {
5151
// Helper to gather 8 bytes at stride 16 into a u64
52-
#[inline]
5352
fn gather(input: &[u8; 128], base: usize) -> u64 {
5453
(input[base] as u64)
5554
| ((input[base + 16] as u64) << 8)
@@ -238,7 +237,6 @@ pub unsafe fn transpose_bits_bmi2(input: &[u8; 128], output: &mut [u8; 128]) {
238237
#[allow(unsafe_op_in_unsafe_fn)]
239238
pub unsafe fn untranspose_bits_bmi2(input: &[u8; 128], output: &mut [u8; 128]) {
240239
// Helper: scatter a u64 to 8 output bytes at stride 16
241-
#[inline]
242240
fn scatter(output: &mut [u8; 128], base: usize, val: u64) {
243241
output[base] = val as u8;
244242
output[base + 16] = (val >> 8) as u8;

0 commit comments

Comments
 (0)