Function opencl3::context::context::create_context[][src]

pub fn create_context(
    devices: &[*mut c_void],
    properties: *const isize,
    pfn_notify: Option<extern "C" fn(*const i8, *const c_void, usize, *mut c_void)>,
    user_data: *mut c_void
) -> Result<*mut c_void, i32>
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.