Skip to main content

IntegerValues

Enum IntegerValues 

Source
pub enum IntegerValues<'a> {
    I32(DeviceArrayView<'a, i32>),
    I64(DeviceArrayView<'a, i64>),
}
Expand description

Runtime-typed integer values from algorithm results.

This is used for integer-valued outputs that are not necessarily graph vertex IDs, such as component labels, core numbers, and triangle counts.

Variants§

§

I32(DeviceArrayView<'a, i32>)

Values stored as 32-bit signed integers.

§

I64(DeviceArrayView<'a, i64>)

Values stored as 64-bit signed integers.

Implementations§

Source§

impl IntegerValues<'_>

Source

pub fn to_series(&self, runtime: &Runtime) -> Result<Series>

Copies this GPU array into an unnamed cudf Series bound to runtime.

Device-to-device copy: unavoidable because the cugraph C API owns result memory and frees it on drop. Matches Python cudf/cugraph behavior.

Source§

impl<'a> IntegerValues<'a>

Source

pub fn len(&self) -> usize

Number of elements in the value array.

Source

pub fn is_empty(&self) -> bool

Whether the value array is empty.

Source

pub fn to_vec_i64(&self, handle: &EnteredContext<'_>) -> Result<Vec<i64>>

Copy to host as Vec<i64>, widening i32 values if needed.

Source

pub fn to_vec_i32(&self, handle: &EnteredContext<'_>) -> Result<Vec<i32>>

Copy to host as Vec<i32>.

Returns an error if the underlying values are i64, since narrowing could lose data.

Source

pub fn as_i32(&self) -> Option<&DeviceArrayView<'a, i32>>

Get the inner view as &DeviceArrayView<i32>, or None if i64.

Source

pub fn as_i64(&self) -> Option<&DeviceArrayView<'a, i64>>

Get the inner view as &DeviceArrayView<i64>, or None if i32.

Trait Implementations§

Source§

impl<'a> Debug for IntegerValues<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Send for IntegerValues<'a>

§

impl<'a> !Sync for IntegerValues<'a>

§

impl<'a> Freeze for IntegerValues<'a>

§

impl<'a> RefUnwindSafe for IntegerValues<'a>

§

impl<'a> Unpin for IntegerValues<'a>

§

impl<'a> UnsafeUnpin for IntegerValues<'a>

§

impl<'a> UnwindSafe for IntegerValues<'a>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.