pub struct Context { /* private fields */ }
Expand description

Defines a Cuda Context.

Implementations§

source§

impl Context

source

pub fn new(devices: Device) -> Result<Context, DriverError>

Initializes a new Cuda context.

source

pub fn from_c(id: *mut Struct_CUctx_st, devices: Vec<Device>) -> Context

Initializes a new Cuda platform from its C type.

source

pub fn id(&self) -> isize

Returns the id as isize.

source

pub fn id_c(&self) -> *mut Struct_CUctx_st

Returns the id as its C type.

source

pub fn synchronize(&self) -> Result<(), DriverError>

Synchronize this Context.

Trait Implementations§

source§

impl Clone for Context

source§

fn clone(&self) -> Context

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Context

source§

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

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

impl Drop for Context

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Hash for Context

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 IDevice for Context

§

type H = Device

The Hardware representation for this Device.
§

type M = Memory

The Memory representation for this Device.
source§

fn id(&self) -> &isize

Returns the unique identifier of the Device.
source§

fn hardwares(&self) -> &Vec<Device>

Returns the hardwares, which define the Device.
source§

fn alloc_memory(&self, size: size_t) -> Result<Memory, DeviceError>

Allocate memory on the Device.
source§

impl MemorySync for Context

source§

fn sync_in( &self, my_memory: &mut dyn Any, src_device: &dyn Any, src_memory: &dyn Any ) -> Result<(), DeviceError>

FIXME
source§

fn sync_out( &self, my_memory: &dyn Any, dst_device: &dyn Any, dst_memory: &mut dyn Any ) -> Result<(), DeviceError>

FIXME
source§

impl PartialEq for Context

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Context

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> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.