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§
Sourceconst BYTE_WIDTH: usize
const BYTE_WIDTH: usize
Size in bytes of this scalar type.
Required Methods§
Sourcefn from_le_bytes(bytes: &[u8]) -> Self
fn from_le_bytes(bytes: &[u8]) -> Self
Deserialize from a little-endian byte slice.
The slice length must equal BYTE_WIDTH.
Sourcefn to_le_bytes_into(self, buf: &mut [u8])
fn to_le_bytes_into(self, buf: &mut [u8])
Serialize into a little-endian byte buffer.
The buffer length must equal BYTE_WIDTH.
Sourcefn filter_compare_kernel() -> &'static str
fn filter_compare_kernel() -> &'static str
Kernel function name for const-compare mask generation.
Sourcefn compare_col_kernel() -> &'static str
fn compare_col_kernel() -> &'static str
Kernel function name for column-column comparison mask.
Sourcefn allowed_scalar_types() -> &'static [ScalarType]
fn allowed_scalar_types() -> &'static [ScalarType]
ScalarType variants accepted for this type in filter/compare operations.
Provided Methods§
Sourcefn filter_scan_phase1_kernel() -> Option<&'static str>
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:
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).