41 Commits

Author SHA1 Message Date
Ken Barker
1ac8305687 Add new OpenCL extension definitions. 2025-04-19 11:29:27 +01:00
Ken Barker
6a623467c4 cargo fmt update 2025-02-21 11:26:17 +00:00
Ken Barker
c06655c04f Update for Rust edition 2024 2025-02-21 09:55:17 +00:00
Ken Barker
3410826c56 Enable OpenCL optional functions with dynamic feature. 2024-12-04 18:05:19 +00:00
Ken Barker
06c7e5e418 Enable OpenCL core functions with dynamic feature. 2024-12-03 06:58:06 +00:00
Ken Barker
ef8149d6bd Fix clippy issues. 2024-11-26 21:00:21 +00:00
Ken Barker
cbb312f71a Fix clippy nursery lints. 2024-03-31 12:04:08 +01:00
Ken Barker
f8cb2289b0 Fix clippy features and change github workflow. 2024-03-31 10:35:19 +01:00
Ken Barker
2ccaa9f12f Fix compiler and clippy warnings. 2023-11-05 13:28:29 +00:00
Ken Barker
0939b44092 Make Program methods unsafe for issue #58 2022-12-27 11:14:56 +00:00
Ben Black
a081926101 added sync for all threadsafe opencl objects 2022-09-10 10:49:59 +01:00
Ken Barker
caa5c82b64 Add Safety comments and clippy::missing_safety_doc for issue #52 2022-09-04 10:21:51 +01:00
Ken Barker
535b01cf0d Changes for issue #52 2022-08-23 20:50:02 +01:00
Ken Barker
ac10fc9cdd Use unsafe release_* functions for issue #51 2022-08-09 20:29:34 +01:00
Ken Barker
02d5f68e8e Remove cl3 Info enums for issue #41 2021-10-10 17:44:44 +01:00
Ken Barker
6f8315458d Add From traits for issue #42. 2021-10-09 14:53:25 +01:00
Ken Barker
5176087713 Replace other to_* calls for issue #40. 2021-10-03 12:02:57 +01:00
Ken Barker
7b135ee0a6 Fix tests using cl3 0.5 for issue #40 2021-10-03 10:56:02 +01:00
Ken Barker
be0f6b5237 Format with cargo fmt. 2021-08-20 17:43:11 +01:00
Ken Barker
5e4166080d Incorporate clippy comments. 2021-08-20 17:25:41 +01:00
Volker Mische
85196d1368 Don't feature guard methods 2021-08-20 15:42:51 +02:00
Volker Mische
87910a8fe9 Implement CL_VERSION_* features
`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.
2021-08-19 15:48:23 +02:00
Ken Barker
3256dcda73 Change more occurrences for issue #24
Also add `Sampler` methods for `get_sampler_info`.
2021-07-10 10:30:19 +01:00
Ken Barker
e8ea59d862 Import c_void to fix issue #20 2021-07-02 08:48:16 +01:00
Ken Barker
e92f885e8e Add OpenCL cl_ext.h functions. 2021-05-21 11:17:57 +01:00
Ken Barker
8248c4c0dc Add #[derive(Debug)] for issue #14 2021-05-20 15:22:32 +01:00
Ken Barker
c8a72a83c1 Disable tests for different hardware. 2021-04-18 11:58:57 +01:00
Ken Barker
3d1dc5aa73 Redesign Program for issue #12
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.
2021-04-17 12:48:21 +01:00
Ken Barker
ce5dea1b2d Make constructors consistent for issue #12
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.
2021-04-11 12:29:21 +01:00
Ken Barker
ba39c61041 Redesign Context for issue #12 2021-04-10 17:06:19 +01:00
Ken Barker
d95946a2d3 Add custom Result type for issue #12
Add Result type to lib.rs and use it in the other files to display errors using the `error_text` function from  the `cl3` crate.
2021-04-04 12:17:16 +01:00
Ken Barker
db8cdcb12e Add missing get function for Program. 2021-04-03 16:16:40 +01:00
Ken Barker
3084b97060 Replace use of CStr with str and CString with String for issue #10 2021-03-28 09:26:13 +01:00
Ken Barker
d46d2f0fa2 Revert changes to Context interface to reduce API changes 2021-03-26 18:11:34 +00:00
Ken Barker
ab1279a02e Replace calls to to_str with to_string for issue #10
The first stage in migrating the API from CString to String.
2021-03-21 17:35:28 +00:00
Ken Barker
ae56fa5dee Replace unwrap with expect for issue #5 2021-03-13 11:21:17 +00:00
Ken Barker
f435acc404 Map CString Utf8Errors to a CSTRING_UTF8_CONVERSION_ERROR for issue #5
Replace all occurrences of  .to_str(),unwrap() to  .to_str().map_err(|_| error_codes::CSTRING_UTF8_CONVERSION_ERROR)
2021-03-12 17:40:38 +00:00
Ken Barker
bfc199ee66 Add Program methods and documentation. 2021-01-04 07:41:41 +00:00
Ken Barker
74888caa29 Update Context.
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.
2021-01-03 11:33:37 +00:00
Ken Barker
a8ee2d9396 Fix integration tests on Intel Skylake 2020-12-31 17:48:13 +00:00
Ken Barker
046f1703ff Initial release. 2020-12-31 15:38:28 +00:00