Function cl3::context::create_context[][src]

pub fn create_context(
    devices: &[cl_device_id],
    properties: *const cl_context_properties,
    pfn_notify: Option<extern "C" fn(_: *const c_char, _: *const c_void, _: size_t, _: *mut c_void)>,
    user_data: *mut c_void
) -> Result<cl_context, cl_int>
Expand description

Create an OpenCL context.
Calls clCreateContext to create an OpenCL context.

  • devices - a slice of unique devices 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.