OpenCL-Docs icon indicating copy to clipboard operation
OpenCL-Docs copied to clipboard

remove unavoidable error conditions

Open bashbaug opened this issue 1 year ago • 0 comments

Philosophically, it should be possible for a well-written OpenCL program to execute without generating any OpenCL errors. This means that no error conditions should be "unavoidable", where the only way to determine if an operation will be successful is to try making an API call and then check the returned error code.

This issue is to document places in the OpenCL spec where there are currently "unavoidable" error conditions and to document how to remove them. This will likely need to be done in a minor OpenCL API revision, since it is a change to specified behavior.

  1. clGetPlatformIDs returns CL_PLATFORM_NOT_FOUND_KHR if the cl_khr_icd extension is supported and zero platforms are available.
    • Why couldn't this just return CL_SUCCESS and num_platforms equal to zero, instead?
  2. clGetDeviceIDs returns CL_DEVICE_NOT_FOUND if no devices in the platform match the requested device type.
    • This is true even for CL_DEVICE_TYPE_ALL.
    • Why couldn't this just return CL_SUCCESS and num_devices equal to zero, instead?

bashbaug avatar Oct 02 '24 17:10 bashbaug