Skip to main content

CudaBuffer

Struct CudaBuffer 

Source
pub struct CudaBuffer {
    pub columns: Vec<CudaColumn>,
    pub row_cap: u64,
    pub d_num_rows: TrackedCudaSlice<u32>,
    pub schema: Schema,
    /* private fields */
}
Expand description

Column-oriented GPU buffer

Holds columnar data on the GPU with an associated schema. Each column is stored as a separate CudaSlice<u8>.

Fields§

§columns: Vec<CudaColumn>

Column data stored as raw bytes

§row_cap: u64

Row capacity for allocated columns

§d_num_rows: TrackedCudaSlice<u32>

Device-resident row count (len = 1)

§schema: Schema

Schema describing the column types

Implementations§

Source§

impl CudaBuffer

Source

pub fn from_columns( columns: Vec<CudaColumn>, row_cap: u64, d_num_rows: TrackedCudaSlice<u32>, schema: Schema, ) -> Self

Create a buffer from existing columns

§Arguments
  • columns - Pre-allocated column data
  • row_cap - Row capacity for the buffer
  • d_num_rows - Device-resident row count
  • schema - Schema describing the columns
§Panics

Panics if the number of columns doesn’t match the schema arity

Source

pub fn from_columns_with_host_count( columns: Vec<CudaColumn>, row_cap: u64, d_num_rows: TrackedCudaSlice<u32>, schema: Schema, host_row_count: u32, ) -> Self

Like from_columns, but eagerly populates the row-count cache. Use when the host already knows the exact row count (e.g., buffer_from_columns).

Source

pub fn cached_row_count(&self) -> Option<u32>

Returns the cached row count if available (not sentinel u32::MAX).

Source

pub fn set_cached_row_count_if_unset(&self, count: u32)

Sets the cached row count if not already set (CAS from sentinel). No-op if already cached.

Source

pub fn num_rows(&self) -> u64

Get the row capacity

Source

pub fn num_rows_device(&self) -> &TrackedCudaSlice<u32>

Get the device-resident row count

Source

pub fn is_empty(&self) -> bool

Check if the buffer has zero row capacity

Source

pub fn schema(&self) -> &Schema

Get the schema

Source

pub fn arity(&self) -> usize

Get the number of columns (arity)

Source

pub fn estimated_bytes(&self) -> u64

Estimated memory usage in bytes

Source

pub fn column(&self, index: usize) -> Option<&CudaColumn>

Get a reference to a specific column by index

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,