[][src]Function opencl3::memory::create_buffer

pub fn create_buffer(
    context: *mut c_void,
    flags: u64,
    size: usize,
    host_ptr: *mut c_void
) -> Result<*mut c_void, i32>

Create an OpenCL buffer object for a context.
Calls clCreateBuffer to create an OpenCL buffer object.

  • 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.
  • size - the size in bytes of the buffer memory object 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.