[][src]Struct open_cl_low_level::object_wrapper::ObjectWrapper

pub struct ObjectWrapper<T: ClObject + RetainRelease + CheckValidClObject> { /* fields omitted */ }

Methods

impl<T: ClObject + RetainRelease + CheckValidClObject> ObjectWrapper<T>[src]

pub unsafe fn unchecked_new(object: T) -> Self[src]

pub unsafe fn cl_object(&self) -> T[src]

pub unsafe fn cl_object_ref(&self) -> &T[src]

pub unsafe fn cl_object_mut_ref(&mut self) -> &mut T[src]

pub unsafe fn new(object: T) -> Output<Self>[src]

pub unsafe fn retain_new(object: T) -> Output<Self>[src]

pub fn address(&self) -> String[src]

pub fn type_name(&self) -> &'static str[src]

impl ObjectWrapper<cl_command_queue>[src]

pub unsafe fn create(
    context: &ClContext,
    device: &ClDeviceID,
    opt_props: Option<CommandQueueProperties>
) -> Output<ClCommandQueue>
[src]

Create a new ClCommandQueue in the given ClContext on the given ClDeviceID with the given CommandQueueProperties (optional).

Safety

Calling this function with an invalid ClContext or ClDeviceID is undefined behavior.

pub unsafe fn create_from_raw_pointers(
    context: cl_context,
    device: cl_device_id,
    props: cl_command_queue_properties
) -> Output<ClCommandQueue>
[src]

Creates a ClCommandQueue from raw ClObject pointers.

Safety

Passing an invalid ClObject is undefined behavior.

pub unsafe fn create_copy(&self) -> Output<ClCommandQueue>[src]

Creates a copy of a ClCommandQueue. The copy is, in fact, a completely differnt ClCommandQueue that has the same cl_context and cl_device_id as the original.

Safety

Calling this function on an invalid ClCommandQueue is undefined behavior.

pub unsafe fn write_buffer<'a, T: ClNumber, H: Into<VecOrSlice<'a, T>>>(
    &mut self,
    mem: &mut ClMem,
    host_buffer: H,
    opts: Option<CommandQueueOptions>
) -> Output<ClEvent>
[src]

write_buffer is used to move data from the host buffer (buffer: &[T]) to the mutable OpenCL cl_mem pointer.

pub unsafe fn read_buffer<'a, T: ClNumber, H: Into<MutVecOrSlice<'a, T>>>(
    &mut self,
    mem: &ClMem,
    host_buffer: H,
    opts: Option<CommandQueueOptions>
) -> Output<BufferReadEvent<T>>
[src]

Copies data from a ClMem buffer to a &mut [T] or mut Vec.

pub unsafe fn enqueue_kernel(
    &mut self,
    kernel: &mut ClKernel,
    work: &Work,
    opts: Option<CommandQueueOptions>
) -> Output<ClEvent>
[src]

Enqueues a ClKernel onto a the ClCommandQueue.

Safety

Usage of invalid ClObjects is undefined behavior.

pub unsafe fn finish(&mut self) -> Output<()>[src]

impl ObjectWrapper<*mut _cl_context>[src]

pub unsafe fn create<D>(devices: &[D]) -> Output<ClContext> where
    D: DevicePtr
[src]

impl ObjectWrapper<*mut _cl_event>[src]

pub fn time(&self, info: ProfilingInfo) -> Output<u64>[src]

pub fn queue_time(&self) -> Output<u64>[src]

pub fn submit_time(&self) -> Output<u64>[src]

pub fn start_time(&self) -> Output<u64>[src]

pub fn end_time(&self) -> Output<u64>[src]

pub fn profiling(&self) -> Profiling[src]

pub unsafe fn info<T: Copy>(&self, flag: EventInfo) -> Output<ClPointer<T>>[src]

pub fn reference_count(&self) -> Output<u32>[src]

pub unsafe fn cl_command_queue(&self) -> Output<cl_command_queue>[src]

pub unsafe fn command_queue(&self) -> Output<ClCommandQueue>[src]

pub unsafe fn cl_context(&self) -> Output<cl_context>[src]

pub unsafe fn context(&self) -> Output<ClContext>[src]

pub fn command_execution_status(&self) -> Output<CommandExecutionStatus>[src]

impl ObjectWrapper<*mut _cl_kernel>[src]

pub unsafe fn create(program: &ClProgram, name: &str) -> Output<ClKernel>[src]

Creates a wrapped cl_kernel object.

Safety

Calling this function with an invalid ClProgram is undefined behavior.

pub unsafe fn set_arg<T: KernelArg>(
    &mut self,
    arg_index: usize,
    arg: &mut T
) -> Output<()>
[src]

Set adds and arg to a kernel at a given index.

Safety

Calling this function on invalid kernel or with invalid arg is undefined behavior.

pub unsafe fn set_arg_raw(
    &mut self,
    arg_index: u32,
    arg_size: usize,
    arg_ptr: *const c_void
) -> Output<()>
[src]

impl ObjectWrapper<*mut _cl_program>[src]

pub unsafe fn create_with_source(
    context: &ClContext,
    src: &str
) -> Output<ClProgram>
[src]

Creates a new ClProgram on the context and device with the given OpenCL source code.

Safety

The provided ClContext and ClDeviceID must be in valid state or else undefined behavior is expected.

pub unsafe fn create_with_binary(
    context: &ClContext,
    device: &ClDeviceID,
    bin: &[u8]
) -> Output<ClProgram>
[src]

Creates a new ClProgram on the context and device with the given executable binary.

Safety

The provided ClContext and ClDeviceID must be in valid state or else undefined behavior is expected.

pub fn build<D>(&mut self, devices: &[D]) -> Output<()> where
    D: DevicePtr
[src]

pub fn get_log<D: DevicePtr>(&self, device: &D) -> Output<String>[src]

Trait Implementations

impl<T: RetainRelease> Clone for ObjectWrapper<T>[src]

impl CommandQueuePtr for ObjectWrapper<cl_command_queue>[src]

impl<T: ClObject + RetainRelease> Debug for ObjectWrapper<T>[src]

impl<T: RetainRelease> Drop for ObjectWrapper<T>[src]

impl<T: ClObject + RetainRelease> Eq for ObjectWrapper<T>[src]

impl<T: ClObject + RetainRelease> PartialEq<ObjectWrapper<T>> for ObjectWrapper<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for ObjectWrapper<T> where
    T: RefUnwindSafe

impl<T> Send for ObjectWrapper<T> where
    T: Send

impl<T> Sync for ObjectWrapper<T> where
    T: Sync

impl<T> Unpin for ObjectWrapper<T> where
    T: Unpin

impl<T> UnwindSafe for ObjectWrapper<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.