Struct Session

Source
pub struct Session { /* private fields */ }

Implementations§

Source§

impl Session

Source

pub fn create_with_devices<'a, D>( devices: D, src: &str, cq_props: Option<CommandQueueProperties>, ) -> Output<Vec<Session>>
where D: Into<VecOrSlice<'a, Device>>,

Source

pub fn create( src: &str, cq_props: Option<CommandQueueProperties>, ) -> Output<Vec<Session>>

Source

pub fn context(&self) -> Context

Source

pub fn device(&self) -> Device

Source

pub fn program(&self) -> Program

Source

pub fn read_queue(&self) -> RwLockReadGuard<'_, ClCommandQueue>

Source

pub fn write_queue(&self) -> RwLockWriteGuard<'_, ClCommandQueue>

Source

pub fn low_level_device(&self) -> &ClDeviceID

Source

pub fn low_level_context(&self) -> &ClContext

Source

pub fn low_level_program(&self) -> &ClProgram

Source

pub fn create_copy(&self) -> Output<Session>

Source

pub fn create_kernel(&self, kernel_name: &str) -> Output<Kernel>

Creates a ClKernel from the session’s program.

Source

pub fn create_buffer<T: ClNumber, B: BufferCreator<T>>( &self, buffer_creator: B, ) -> Output<Buffer>

Creates a ClMem object in the given context, with the given buffer creator (either a length or some data). This function uses the BufferCreator’s implementation to retrieve the appropriate MemConfig.

Source

pub fn create_buffer_with_config<T: ClNumber, B: BufferCreator<T>>( &self, buffer_creator: B, mem_config: MemConfig, ) -> Output<Buffer>

Creates a ClMem object in the given context, with the given buffer creator (either a length or some data) and a given MemConfig.

Source

pub fn sync_write_buffer<'a, T: ClNumber, H: Into<VecOrSlice<'a, T>>>( &self, buffer: &Buffer, host_buffer: H, opts: Option<CommandQueueOptions>, ) -> Output<()>

This function copies data from the host buffer into the device mem buffer. The host buffer must be a mutable slice or a vector to ensure the safety of the read_Buffer operation.

Source

pub fn sync_read_buffer<'a, T: ClNumber, H: Into<MutVecOrSlice<'a, T>>>( &self, buffer: &Buffer, host_buffer: H, opts: Option<CommandQueueOptions>, ) -> Output<Option<Vec<T>>>

This function copies data from a device mem buffer into a host buffer. The host buffer must be a mutable slice or a vector. For the moment the device mem must also be passed as mutable; I don’t trust OpenCL.

Source

pub fn sync_enqueue_kernel( &self, kernel: &Kernel, work: &Work, opts: Option<CommandQueueOptions>, ) -> Output<()>

This function enqueues a CLKernel into a command queue

§Safety

If the ClKernel is not in a usable state or any of the Kernel’s dependent object has been release, or the kernel belongs to a different session, or the ClKernel’s pointer is a null pointer, then calling this function will cause undefined behavior.

Source

pub fn execute_sync_kernel_operation<'a, T>( &self, kernel_op: KernelOperation<'a, T>, ) -> Output<()>
where T: ClNumber + KernelArg,

Trait Implementations§

Source§

impl Clone for Session

Source§

fn clone(&self) -> Session

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 Session

Source§

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

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

impl Drop for Session

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl PartialEq for Session

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Eq for Session

Source§

impl Send for Session

Source§

impl Sync for Session

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