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

pub struct Buffer<T> { /* fields omitted */ }
Expand description

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

Implementations

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.

Create an OpenCL buffer object for a context from an OpenGL buffer.

  • context - a valid OpenCL context created from an OpenGL context.
  • flags - a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.
  • bufobj - the OpenGL buffer.

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

Create an new OpenCL buffer object from an existing buffer object.
See: SubBuffer Attributes.

  • flags - a bit-field used to specify allocation and usage information about the sub-buffer memory object being created, see: Memory Flags.
  • origin - the offset in number of objects of type .
  • count - the size of the sub-buffer in number of objects of type .

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

Trait Implementations

CL_VERSION_3_0

Query an OpenGL object used to create an OpenCL memory object. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.