By default, the `opencl3` crate activates the `dynamic` feature flag of the `cl3` crate, which overrides the `static` flag. This means that it's impossible to do static linking with `opencl3`.
This patch adds `default-features = true` to the `cl3` dep entry, which disables the `dynamic` flag unless the `opencl3` crate's `dynamic` flag is turned on.
In the `device` module, all public items from `cl3::device` are re-exported.
They even [show up as public in the documentation]. Nonetheless they aren't
actually public.
To reproduce this issue, try to import `opencl3::device::CL_UUID_SIZE_KHR`,
you will get an error like:
error[E0603]: constant `CL_UUID_SIZE_KHR` is private
--> src/device.rs:2209:30
|
2209 | opencl3::device::CL_UUID_SIZE_KHR,
| ^^^^^^^^^^^^^^^^ private constant
|
note: the constant `CL_UUID_SIZE_KHR` is defined here
--> /home/vmx/src/pl/filecoin/upstream/opencl3/src/device.rs:45:23
|
45 | CL_LUID_SIZE_KHR, CL_UUID_SIZE_KHR,
| ^^^^^^^^^^^^^^^^
The private imports at
d004f1cf5f/src/device.rs (L18)
shadow the previous public re-exports
d004f1cf5f/src/device.rs (L15)
As most of the private imports are a subset of the public re-exports, we can
just import the missing ones, which in this case is only
`cl_device_feature_capabilities_intel`.
In order verify the subset, you can copy the list of [imports from `cl3::ext`]
and the [`cl3::device` re-exports from `opencl-sys`] into two fiels and run
` tr ',' '\n|awk '{$1=$1;print}'|sort` on each of them and finally diff the
results.
[show up as public in the documentation]: https://docs.rs/opencl3/0.9.0/opencl3/device/constant.CL_UUID_SIZE_KHR.html
[imports from `cl3::ext`]: d004f1cf5f/src/device.rs (L19-L45)
[`cl3::device` re-exports from `opencl-sys`]: 9c97521ab2/src/device.rs (L21-L106)