Skip to main content

DataType

Enum DataType 

Source
#[non_exhaustive]
#[repr(u32)]
pub enum DataType {
Show 34 variants F16 = 2, ComplexF16 = 6, Bf16 = 14, ComplexBf16 = 15, F32 = 0, ComplexF32 = 4, F64 = 1, ComplexF64 = 5, I4 = 16, ComplexI4 = 17, U4 = 18, ComplexU4 = 19, I8 = 3, ComplexI8 = 7, U8 = 8, ComplexU8 = 9, I16 = 20, ComplexI16 = 21, U16 = 22, ComplexU16 = 23, I32 = 10, ComplexI32 = 11, U32 = 12, ComplexU32 = 13, I64 = 24, ComplexI64 = 25, U64 = 26, ComplexU64 = 27, F8E4M3 = 28, F8E5M2 = 29, F8UE8M0 = 30, F6E2M3 = 31, F6E3M2 = 32, F4E2M1 = 33,
}
Expand description

Rust wrapper for CUDA’s data type enum.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

F16 = 2

16-bit real half precision floating-point (IEEE 754-2008 binary16).

§

ComplexF16 = 6

32-bit complex (2x16-bit half precision floats).

§

Bf16 = 14

16-bit real bfloat16 floating-point.

§

ComplexBf16 = 15

32-bit complex (2x16-bit bfloat16 floats).

§

F32 = 0

32-bit real single precision floating-point (IEEE 754 binary32).

§

ComplexF32 = 4

64-bit complex (2x32-bit single precision floats).

§

F64 = 1

64-bit real double precision floating-point (IEEE 754 binary64).

§

ComplexF64 = 5

128-bit complex (2x64-bit double precision floats).

§

I4 = 16

4-bit real signed integer.

§

ComplexI4 = 17

8-bit complex (2x4-bit signed integers).

§

U4 = 18

4-bit real unsigned integer.

§

ComplexU4 = 19

8-bit complex (2x4-bit unsigned integers).

§

I8 = 3

8-bit real signed integer.

§

ComplexI8 = 7

16-bit complex (2x8-bit signed integers).

§

U8 = 8

8-bit real unsigned integer.

§

ComplexU8 = 9

16-bit complex (2x8-bit unsigned integers).

§

I16 = 20

16-bit real signed integer.

§

ComplexI16 = 21

32-bit complex (2x16-bit signed integers).

§

U16 = 22

16-bit real unsigned integer.

§

ComplexU16 = 23

32-bit complex (2x16-bit unsigned integers).

§

I32 = 10

32-bit real signed integer.

§

ComplexI32 = 11

64-bit complex (2x32-bit signed integers).

§

U32 = 12

32-bit real unsigned integer.

§

ComplexU32 = 13

64-bit complex (2x32-bit unsigned integers).

§

I64 = 24

64-bit real signed integer.

§

ComplexI64 = 25

128-bit complex (2x64-bit signed integers).

§

U64 = 26

64-bit real unsigned integer.

§

ComplexU64 = 27

128-bit complex (2x64-bit unsigned integers).

§

F8E4M3 = 28

8-bit real floating point in E4M3 format.

§

F8E5M2 = 29

8-bit real floating point in E5M2 format.

§

F8UE8M0 = 30

8-bit real floating point in E8M0 format (unsigned exponent, zero mantissa bits).

§

F6E2M3 = 31

6-bit real floating point in E2M3 format (2-bit exponent, 3-bit mantissa).

§

F6E3M2 = 32

6-bit real floating point in E3M2 format (3-bit exponent, 2-bit mantissa).

§

F4E2M1 = 33

4-bit real floating point in E2M1 format (2-bit exponent, 1-bit mantissa).

Implementations§

Source§

impl DataType

Source

pub const fn size_of(self) -> usize

Trait Implementations§

Source§

impl Clone for DataType

Source§

fn clone(&self) -> DataType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DataType

Source§

impl Debug for DataType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DataType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DataType

Source§

impl From<DataType> for u32

Source§

fn from(enum_value: DataType) -> Self

Converts to this type from the input type.
Source§

impl From<DataType> for cudaDataType_t

Source§

fn from(value: DataType) -> Self

Converts to this type from the input type.
Source§

impl From<cudaDataType_t> for DataType

Source§

fn from(value: cudaDataType_t) -> Self

Converts to this type from the input type.
Source§

impl Hash for DataType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DataType

Source§

fn eq(&self, other: &DataType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for DataType

Source§

impl TryFrom<u32> for DataType

Source§

type Error = TryFromPrimitiveError<DataType>

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

fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for DataType

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.