Function pocky_opencl_context_from_device_list

Function Documentation

cl_int pocky_opencl_context_from_device_list(size_t num_devices, cl_device_id *devices, cl_context *ctx)

Creates a context from an array of devices.

Important

The user is responsible for checking the return code before using the context in ctx, since the handle is not valid if the context for the requested devices could not be created.

Parameters:
  • num_devices[in] Number of devices in the devices array

  • devices[in] Array of devices to include in the context

  • ctx[out] Created context for these devices

Returns:

On success, CL_SUCCESS, otherwise an OpenCL error code