Skip to main content

DeviceElement

Trait DeviceElement 

Source
pub trait DeviceElement:
    CudfType
    + Copy
    + 'static {
    const DLPACK_CODE: u8;
    const DLPACK_BITS: u8;
    const INTEROP_TYPE: InteropTypeId;

    // Provided methods
    fn valid_native_input(_values: &[Self]) -> bool { ... }
    fn validate_native_buffer(
        _buffer: &CudfDeviceBuffer,
        _operation: &'static str,
    ) -> Result<()> { ... }
}
Expand description

Element type of a cuVS device buffer or tensor.

Implemented for f32, f64, i8, u8, i32, and i64. The sealed supertrait CudfType restricts implementations to this crate.

Required Associated Constants§

Source

const DLPACK_CODE: u8

DLPack type code used, with DLPACK_BITS and one lane, to describe tensors of this element to cuVS.

Source

const DLPACK_BITS: u8

DLPack element width in bits.

Source

const INTEROP_TYPE: InteropTypeId

RAPIDS interop type a prepared cuDF column must carry to be read as a tensor of this element.

Provided Methods§

Source

fn valid_native_input(_values: &[Self]) -> bool

Returns whether host values are valid native cuVS input.

Floating elements require finite values; integer elements accept every value.

Source

fn validate_native_buffer( _buffer: &CudfDeviceBuffer, _operation: &'static str, ) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DeviceElement for f32

Source§

const DLPACK_CODE: u8

Source§

const DLPACK_BITS: u8 = 32

Source§

const INTEROP_TYPE: InteropTypeId = InteropTypeId::Float32

Source§

fn valid_native_input(values: &[Self]) -> bool

Source§

fn validate_native_buffer( buffer: &CudfDeviceBuffer, operation: &'static str, ) -> Result<()>

Source§

impl DeviceElement for f64

Source§

const DLPACK_CODE: u8

Source§

const DLPACK_BITS: u8 = 64

Source§

const INTEROP_TYPE: InteropTypeId = InteropTypeId::Float64

Source§

fn valid_native_input(values: &[Self]) -> bool

Source§

fn validate_native_buffer( buffer: &CudfDeviceBuffer, operation: &'static str, ) -> Result<()>

Source§

impl DeviceElement for i8

Source§

const DLPACK_CODE: u8

Source§

const DLPACK_BITS: u8 = 8

Source§

const INTEROP_TYPE: InteropTypeId = InteropTypeId::Int8

Source§

impl DeviceElement for i32

Source§

const DLPACK_CODE: u8

Source§

const DLPACK_BITS: u8 = 32

Source§

const INTEROP_TYPE: InteropTypeId = InteropTypeId::Int32

Source§

impl DeviceElement for i64

Source§

const DLPACK_CODE: u8

Source§

const DLPACK_BITS: u8 = 64

Source§

const INTEROP_TYPE: InteropTypeId = InteropTypeId::Int64

Source§

impl DeviceElement for u8

Source§

const DLPACK_CODE: u8

Source§

const DLPACK_BITS: u8 = 8

Source§

const INTEROP_TYPE: InteropTypeId = InteropTypeId::UInt8

Implementors§