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 unsafe fn dlpack( ptr: CUdeviceptr, len_bytes: usize, stream: Arc<CudaStream>, tensor: DlpackManagedTensor, ) -> Self

Construct a column over an authenticated foreign allocation.

§Safety

The byte range must be live in stream’s CUDA context and retained by tensor. The producer must have completed its work before handoff and must coordinate subsequent non-XLOG accesses for the whole import lifetime.

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 unsafe fn arrow_device( ptr: CUdeviceptr, len_bytes: usize, stream: Arc<CudaStream>, import: Arc<ArrowDeviceImport>, ) -> Self

Construct a column over an authenticated Arrow device allocation.

§Safety

import must retain this live byte range in stream’s CUDA context. Producer work must be complete and subsequent non-XLOG access coordinated for the entire lifetime of this imported storage.

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 memory_manager_ptr_value(&self) -> Option<usize>

Stable identity of the xlog memory manager that owns this column.

True external DLPack and Arrow device columns return None; wrappers retaining an xlog-owned source slice preserve that slice’s identity.

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§

Auto Trait Implementations§

Blanket Implementations§

§

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

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> Same for T

Source§

type Output = T

Should always be Self
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.