Skip to main content

GpuScalar

Trait GpuScalar 

Source
pub trait GpuScalar:
    Sealed
    + KernelScalar
    + Copy
    + Send
    + 'static {
    const BYTE_WIDTH: usize;

    // Required methods
    fn from_le_bytes(bytes: &[u8]) -> Self;
    fn to_le_bytes_into(self, buf: &mut [u8]);
    fn filter_compare_kernel() -> &'static str;
    fn compare_col_kernel() -> &'static str;
    fn allowed_scalar_types() -> &'static [ScalarType];

    // Provided method
    fn filter_scan_phase1_kernel() -> Option<&'static str> { ... }
}
Expand description

Marker trait: a Rust scalar type that can round-trip through GPU column storage.

Requires cudarc::driver::DeviceRepr + known byte width + little-endian serialization.

This trait is sealed — it cannot be implemented outside xlog-cuda. The fixed set of implementations covers all GPU-compatible scalar types.

Required Associated Constants§

Source

const BYTE_WIDTH: usize

Size in bytes of this scalar type.

Required Methods§

Source

fn from_le_bytes(bytes: &[u8]) -> Self

Deserialize from a little-endian byte slice. The slice length must equal BYTE_WIDTH.

Source

fn to_le_bytes_into(self, buf: &mut [u8])

Serialize into a little-endian byte buffer. The buffer length must equal BYTE_WIDTH.

Source

fn filter_compare_kernel() -> &'static str

Kernel function name for const-compare mask generation.

Source

fn compare_col_kernel() -> &'static str

Kernel function name for column-column comparison mask.

Source

fn allowed_scalar_types() -> &'static [ScalarType]

ScalarType variants accepted for this type in filter/compare operations.

Provided Methods§

Source

fn filter_scan_phase1_kernel() -> Option<&'static str>

Optional fused compare+scan kernel (phase 1). Only u32 and f64 have optimized fused-scan paths. Returns None for types using the mask+compact path.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl GpuScalar for bool

Bool encoding:

  • Write (H2D): 0x00 = false, 0x01 = true (canonical).
  • Read (D2H): 0x00 = false, nonzero = true (lenient, matches the D2H bool decoding path in provider/transfer.rs).
Source§

const BYTE_WIDTH: usize = 1

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

impl GpuScalar for f32

Source§

const BYTE_WIDTH: usize = 4

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

impl GpuScalar for f64

Source§

const BYTE_WIDTH: usize = 8

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

fn filter_scan_phase1_kernel() -> Option<&'static str>

Source§

impl GpuScalar for i32

Source§

const BYTE_WIDTH: usize = 4

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

impl GpuScalar for i64

Source§

const BYTE_WIDTH: usize = 8

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

impl GpuScalar for u8

Source§

const BYTE_WIDTH: usize = 1

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

impl GpuScalar for u32

Source§

const BYTE_WIDTH: usize = 4

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Source§

fn filter_scan_phase1_kernel() -> Option<&'static str>

Source§

impl GpuScalar for u64

Source§

const BYTE_WIDTH: usize = 8

Source§

fn from_le_bytes(bytes: &[u8]) -> Self

Source§

fn to_le_bytes_into(self, buf: &mut [u8])

Source§

fn filter_compare_kernel() -> &'static str

Source§

fn compare_col_kernel() -> &'static str

Source§

fn allowed_scalar_types() -> &'static [ScalarType]

Implementors§