JuliaGPU / OpenCL.jl

OpenCL Julia bindings

Home Page:https://juliagpu.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose function interface for `cl.info`

miakramer opened this issue · comments

I've been playing around with this package, and I think the API might be improved by exposing certain info calls. Internally, many of them use a Dict from Symbol to Function: I'm just proposing exporting the functions in addition. So, you could either call cl.info(device, :name) or cl.name(device). This increases the number exported functions by quite a bit, but IMO it's a more ergonomic interface and is type-stable, which is nice for user code which depends on this info (avoids having to typeassert). cl.info(device, :max_work_group_size) has return type Any, but exporting cl.max_work_group_size(device) gives a stable return type of UInt64.

I'm happy to do the work (already did device.jl just messing around), just wanted to check if this would be a desired change.

That sounds fine to me!