`openccl3` specifies compile time features for the different OpenCL versions,
but they weren't fully implemented. This PR implements them. The functions
become the `CL_VERSION_*` number when they were introduced. So if you e.g.
want to use OpenCL 1.2 and 2.0 features, you would need to specify the
`CL_VERSION_1_2` and `CL_VERSION_2_0`. All features prior to OpenCL 1.2
are always enabled.
This commit enables you to compile a `opencl3` version with only OpenCL 1.2
features (without any from newer version), which would then run on platforms
that only support OpenCL 1.2 (like MacOS).
Trying out if it can actually built with OpenCL 1.2 features only can be done with:
cargo build --no-default-features --features CL_VERSION_1_2 --all-targets
It was manually tested that compiling with each `CL_VERSION_*` feature
individually, while disabling the other ones, works.
Fixes#30.
When a `cl_mem` is passed around, sometimes a mutable reference is needed.
Add a `get_mut()` method to the `ClMem` trait, so that the mutability
requirements automatically bubble up the API.
Closes#26.
Add kernel_names to program; change: compile, link and build methods to take mutable references; add new "create_and_build_from_*" methods to simplify building programs and add compile, link and build option strings.
Construct opencl3 objects: Context, Program, Kernel and CommandQueue using references to other opencl3 objects to make the function calls consistent with those in memory.rs and svm.rs.
Change create_command_queue and create_command_queue_with_properties to plural forms that creat ecommand queues for all the devices in Context.
Also change Program::create_from_source to accept multiple source strings.