[][src]Struct opencl3::memory::Buffer

pub struct Buffer { /* fields omitted */ }

An OpenCL buffer.
Implements the Drop trait to call release_mem_object when the object is dropped.

Implementations

impl Buffer[src]

pub fn new(buffer: cl_mem) -> Buffer[src]

pub fn create<T>(
    context: &Context,
    flags: cl_mem_flags,
    count: size_t,
    host_ptr: *mut c_void
) -> Result<Buffer, cl_int>
[src]

Create a Buffer for a context.

  • context - a valid OpenCL context.
  • flags - a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.
  • count - the number of T objects to be allocated.
  • host_ptr - a pointer to the buffer data that may already be allocated by the application.

returns a Result containing the new OpenCL buffer object or the error code from the OpenCL C API function.

pub fn create_sub_buffer(
    &self,
    flags: cl_mem_flags,
    buffer_create_type: cl_buffer_create_type,
    buffer_create_info: *const c_void
) -> Result<Buffer, cl_int>
[src]

Create an new OpenCL buffer object from an existing buffer object.

  • flags - a bit-field used to specify allocation and usage information about the sub-buffer memory object being created, see: Memory Flags.
  • buffer_create_type,buffer_create_info - describe the type of buffer object to be created, see: SubBuffer Attributes.

returns a Result containing the new OpenCL buffer object or the error code from the OpenCL C API function.

pub fn get(&self) -> cl_mem[src]

Trait Implementations

impl Drop for Buffer[src]

Auto Trait Implementations

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