Struct opencl3::context::Context [−][src]
pub struct Context { /* fields omitted */ }
Expand description
An OpenCL context object. Implements the Drop trait to call release_context when the object is dropped.
Implementations
Get the underlying OpenCL cl_context.
Create a Context from a slice of cl_device_ids.
devices
- a slice of cl_device_ids for an OpenCL Platform.properties
- a null terminated list of cl_context_properties, see Context Properties.pfn_notify
- an optional callback function that can be registered by the application.user_data
- passed as the user_data argument when pfn_notify is called.
returns a Result containing the new OpenCL context or the error code from the OpenCL C API function.
Create a Context from a slice of SubDevices.
devices
- a slice of SubDevices for an OpenCL Platform.properties
- a null terminated list of cl_context_properties, see Context Properties.pfn_notify
- an optional callback function that can be registered by the application.user_data
- passed as the user_data argument when pfn_notify is called.
returns a Result containing the new OpenCL context or the error code from the OpenCL C API function.
Create a Context from a cl_device_type.
device_type
- the cl_device_type to create a Context for.properties
- a null terminated list of cl_context_properties, see Context Properties.pfn_notify
- an optional callback function that can be registered by the application.user_data
- passed as the user_data argument when pfn_notify is called.
returns a Result containing the new OpenCL context or the error code from the OpenCL C API function.
Get the common Shared Virtual Memory (SVM) capabilities of the devices in the Context.
pub fn get_supported_image_formats(
&self,
flags: cl_mem_flags,
image_type: cl_mem_object_type
) -> Result<Vec<cl_image_format>>
pub fn get_supported_image_formats(
&self,
flags: cl_mem_flags,
image_type: cl_mem_object_type
) -> Result<Vec<cl_image_format>>
Get the list of image formats supported by the Context for an image type,
and allocation information.
Calls clGetSupportedImageFormats to get the desired information about the context.
flags
- a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.image_type
- describes the image type.
returns a Result containing the desired information in an InfoType enum or the error code from the OpenCL C API function.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Context
impl UnwindSafe for Context