Skip to main content

CudaColumn

Enum CudaColumn 

Source
pub enum CudaColumn {
    Owned(TrackedCudaSlice<u8>),
    Dlpack(DlpackColumn),
    ArrowDevice(ArrowDeviceColumn),
}
Expand description

Column data stored in device memory.

Most columns are owned by XLOG (Owned) and tracked against the memory budget. Columns may also be imported via DLPack (Dlpack) or Arrow device (ArrowDevice) without copies; these are freed via the DLPack deleter or Arrow release callback.

Variants§

Implementations§

Source§

impl CudaColumn

Source

pub fn owned(slice: TrackedCudaSlice<u8>) -> Self

Source

pub fn dlpack( ptr: CUdeviceptr, len_bytes: usize, stream: Arc<CudaStream>, tensor: DlpackManagedTensor, ) -> Self

Source

pub fn dlpack_xlog_owned( source_slice: Arc<TrackedCudaSlice<u8>>, stream: Arc<CudaStream>, tensor: DlpackManagedTensor, ) -> Self

Construct a DLPack column that wraps memory xlog itself owns through the device runtime.

Use this when xlog allocated source_slice via the runtime-backed manager and is exporting it as a DLPack tensor for inspection by external code while retaining ownership. The resulting column reports Self::is_external as false and Self::runtime_block returns the slice’s crate::device_runtime::DeviceBlock — strict-mode launch recorders will record it normally instead of rejecting.

True external DLPack producers (DLPack tensors handed to xlog by another framework) must continue to use Self::dlpack.

Source

pub fn arrow_device( ptr: CUdeviceptr, len_bytes: usize, stream: Arc<CudaStream>, import: Arc<ArrowDeviceImport>, ) -> Self

Source

pub fn arrow_device_xlog_owned( source_slice: Arc<TrackedCudaSlice<u8>>, stream: Arc<CudaStream>, import: Arc<ArrowDeviceImport>, ) -> Self

Construct an Arrow device column that wraps memory xlog itself owns through the device runtime. Same contract as Self::dlpack_xlog_owned: identity is preserved, strict recorders accept the column, and drop order keeps the underlying allocation alive through the Arrow handoff.

True external Arrow device producers must continue to use Self::arrow_device.

Source

pub fn stream(&self) -> &Arc<CudaStream>

Source

pub fn device_ptr(&self) -> &CUdeviceptr

Source

pub fn runtime_block(&self) -> Option<&DeviceBlock>

Borrow the underlying crate::device_runtime::DeviceBlock.

Returns Some(&block) when xlog owns the memory through the runtime — Owned slices that were allocated via a runtime-backed manager, AND Dlpack / ArrowDevice columns constructed via the *_xlog_owned constructors (where the source slice’s block is reachable through the retained Arc<TrackedCudaSlice<u8>>).

Returns None for legacy cudarc-backed Owned slices (no runtime block exists) and for true external Dlpack / ArrowDevice columns (xlog never owned the allocation). Strict-mode launch recorders reject None returns; permissive recorders silently skip.

Source

pub fn is_external(&self) -> bool

Whether this column wraps externally-managed device memory.

Returns true only for Dlpack / ArrowDevice columns where xlog never owned the allocation (no source_slice). Dlpack / ArrowDevice columns built via *_xlog_owned constructors return false — xlog still owns the memory; the DLPack / Arrow handle is just an export wrapper.

External memory has no xlog-side runtime identity; strict launch recorders reject such columns and require callers to coordinate cross-stream synchronization themselves.

Trait Implementations§

Source§

impl AsKernelParam for &CudaColumn

Source§

impl AsKernelParam for &mut CudaColumn

Source§

impl DevicePtr<u8> for CudaColumn

Source§

fn device_ptr<'a>( &'a self, stream: &'a CudaStream, ) -> (CUdeviceptr, SyncOnDrop<'a>)

Retrieve the device pointer with the intent to read the device memory associated with it. Read more
Source§

impl DevicePtrMut<u8> for CudaColumn

Source§

fn device_ptr_mut<'a>( &'a mut self, stream: &'a CudaStream, ) -> (CUdeviceptr, SyncOnDrop<'a>)

Retrieve the device pointer with the intent to modify the device memory associated with it. Read more
Source§

impl DeviceSlice<u8> for CudaColumn

Source§

fn len(&self) -> usize

Source§

fn stream(&self) -> &Arc<CudaStream>

§

fn num_bytes(&self) -> usize

§

fn is_empty(&self) -> bool

Source§

impl From<TrackedCudaSlice<u8>> for CudaColumn

Source§

fn from(value: TrackedCudaSlice<u8>) -> Self

Converts to this type from the input type.
Source§

impl<'a> IntoKernelParamStorage for &'a CudaColumn

Source§

impl<'a> IntoKernelParamStorage for &'a mut CudaColumn

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,