kenba/opencl3

Device::available() should return a boolean

Closed this issue · 1 comments

vmx commented

Currently Device::available() returns a cl_int which is a bit confusing (I just had a bug where my logic was wrong due to that). I propose making it return a boolean. That is also what the OpenCL spec suggests: https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_DEVICE_AVAILABLE. That applies also to other clGetDeviceInfo calls, but the CL_DEVICE_AVAILABLE is the one I care most at the moment.

Ideally on the opencl3 level it returns a Rust bool and not a cl_bool, which would again be harder to work with.

kenba commented

Yes Volker, I agree that the clGetDeviceInfo calls that return cl_bool in the spec should be cast to Rust bool in opencl3.

Please feel free to cast the return types in the relevant Device methods in a PR.