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

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.

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

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.