OpenCL.jl icon indicating copy to clipboard operation
OpenCL.jl copied to clipboard

Separated object info APIs

Open miakramer opened this issue 5 years ago • 3 comments

See #190. This commit separates the API for getting info about an object. For example, cl.info(device, :name) is also exposed as name(device). This is a more ergonomic API, both in usage and because the return type is (nearly always) stable.

There are two changes to the API, which I can remove if they're unwanted:

  • The API of binaries(program) changed from Dict{Device, Array{UInt8, N} where N} to Dict{Device, Vector{UInt8}}, as it seemed a vector would always be returned.
  • The API of work_group_compile_size(device, kernel) differs from work_group_info(kernel, :compile_size, device): it returns a tuple with known size rather than a vector.

Additionally, each of these new methods has been given at least basic documentation, with the signature and a brief description including the OpenCL info constant name. Compatibility and deprecation info was added in the Documenter.jl style, so eventually it can be used. For now, they look nice in the REPL help.

miakramer avatar Dec 16 '20 22:12 miakramer

Oh, weird, I didn't expect anything to fail! It looks like the testing device failed to make a queue for the device. I can test on a Linux machine in a few minutes.

miakramer avatar Dec 16 '20 23:12 miakramer

Yeah, so it runs fine on Linux (minus the test that required 64-bit support, the laptop only has intel integrated graphics)

miakramer avatar Dec 17 '20 02:12 miakramer

The tests for this package are seriously unreliable, I wouldn't worry about random failures so long as it works locally. I'll review this the next chance I get.

jpsamaroo avatar Dec 17 '20 02:12 jpsamaroo