Struct collenchyma::frameworks::opencl::API
[−]
[src]
pub struct API;
Defines the OpenCL API.
Methods
impl API
[src]
fn create_context(
devices: Vec<Device>,
properties: *const intptr_t,
callback: extern "C" fn(_: *const c_char, _: *const c_void, _: size_t, _: *mut c_void),
user_data: *mut c_void
) -> Result<*mut c_void, Error>
devices: Vec<Device>,
properties: *const intptr_t,
callback: extern "C" fn(_: *const c_char, _: *const c_void, _: size_t, _: *mut c_void),
user_data: *mut c_void
) -> Result<*mut c_void, Error>
Creates a OpenCL context.
An OpenCL context is created with one or more devices. Contexts are used by the OpenCL runtime for managing objects such as command-queues, memory, program and kernel objects and for executing kernels on one or more devices specified in the context. An OpenCL context is a synonym to a Collenchyma device.
impl API
[src]
fn load_devices(platform: &Platform) -> Result<Vec<Device>, Error>
Returns fully initialized devices for a specific platform.
Combines the fetching of all device ids and the fetching of the individual device information.
fn load_device_list(platform: &Platform) -> Result<Vec<Device>, Error>
Returns a list of available devices for the provided platform.
fn load_device_info(device: &Device, info: u32) -> Result<DeviceInfo, Error>
Returns the requested DeviceInfo for the provided device.
impl API
[src]
fn create_buffer(
context: &Context,
flags: MemoryFlags,
size: usize,
host_pointer: Option<*mut u8>
) -> Result<Memory, Error>
context: &Context,
flags: MemoryFlags,
size: usize,
host_pointer: Option<*mut u8>
) -> Result<Memory, Error>
Allocates memory on the OpenCL device.
A buffer object stores a one-dimensional collection of elements. Elements of a buffer object can be a scalar data type (such as an int, float), vector data type, or a user-defined structure. Returns a memory id for the created buffer, which can now be writen to.
fn release_memory(memory: &mut Memory) -> Result<(), Error>
Releases allocated memory from the OpenCL device.
fn read_from_memory(
queue: &Queue,
mem: &Memory,
blocking_read: bool,
offset: usize,
size: usize,
host_mem: *mut c_void,
event_wait_list: &[Event]
) -> Result<Event, Error>
queue: &Queue,
mem: &Memory,
blocking_read: bool,
offset: usize,
size: usize,
host_mem: *mut c_void,
event_wait_list: &[Event]
) -> Result<Event, Error>
Reads from a OpenCL memory object to the host memory.
With write_to_memory you can do the opposite, write from the host memory to a OpenCL memory object.
fn write_to_memory(
queue: &Queue,
mem: &mut Memory,
blocking_write: bool,
offset: usize,
size: usize,
host_mem: *const c_void,
event_wait_list: &[Event]
) -> Result<Event, Error>
queue: &Queue,
mem: &mut Memory,
blocking_write: bool,
offset: usize,
size: usize,
host_mem: *const c_void,
event_wait_list: &[Event]
) -> Result<Event, Error>
Write to a OpenCL memory object from host memory.
With read_from_memory you can do the opposite, read from a OpenCL memory object to host memory.
impl API
[src]
fn load_platforms() -> Result<Vec<Platform>, Error>
Returns a list of available platforms.
The OpenCL platform layer which implements platform-specific features that allow applications to
- query OpenCL devices,
- obtain device configuration information and
- create OpenCL contexts using one or more devices.
impl API
[src]
fn create_queue(
context: &Context,
device: &Device,
queue_flags: &QueueFlags
) -> Result<Queue, Error>
context: &Context,
device: &Device,
queue_flags: &QueueFlags
) -> Result<Queue, Error>
Returns a command queue for a specified context and device.
OpenCL command queues are used to control memory allocation and operations for a single device.
fn release_queue(queue: &mut Queue) -> Result<(), Error>
Releases command queue from the OpenCL device.
Trait Implementations
impl Debug for API
[src]
impl Copy for API
[src]
impl Clone for API
[src]
fn clone(&self) -> API
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more