36 Commits

Author SHA1 Message Date
Ken Barker
6a623467c4 cargo fmt update 2025-02-21 11:26:17 +00:00
Ken Barker
7d01e0178f Update to use cl3 version 0.12.0 2025-02-19 19:24:40 +00:00
Ken Barker
5c8e67bcef Declare set_len unsafe for issue #69 2024-12-15 13:34:30 +00:00
Ken Barker
06c7e5e418 Enable OpenCL core functions with dynamic feature. 2024-12-03 06:58:06 +00:00
Ken Barker
4a04e4a25e Update opencl2_kernel_test.rs 2024-12-03 06:35:45 +00:00
Ken Barker
535b01cf0d Changes for issue #52 2022-08-23 20:50:02 +01:00
Ken Barker
710dce07c2 Correct use of CL_MEM_READ_ONLY and CL_MEM_WRITE_ONLY for issue #45 2021-12-10 13:10:49 +00:00
Ken Barker
f4f0cf9094 Add SVM fine grain system support for issue #38 2021-10-03 09:45:08 +01:00
Ken Barker
b0ad8a2137 Improve integration tests and README example. 2021-09-12 11:56:48 +01:00
Ken Barker
0351b2e7b9 Remove svm_capabilities parameter from SvmVec methods. 2021-09-12 11:25:12 +01:00
Ken Barker
6ba2ad0593 Improve SVM interface and documentation. 2021-09-12 09:20:53 +01:00
Ken Barker
3e92118d03 SVM WIP 2021-09-11 13:11:40 +01:00
Ken Barker
9ca07eac62 Fix test_opencl_svm_example for coarse SVM for issue #33. 2021-09-10 16:05:37 +01:00
Ken Barker
1a696c7143 Update integration tests to handle OpenCL 3 platforms. 2021-09-10 11:59:52 +01: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
Volker Mische
011ffe38b0 Make mutability explicit
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.
2021-08-11 11:29:58 +02:00
Ken Barker
7ae2c1a192 Use CL_BLOCKING and CL_NON_BLOCKING in enqueue calls for issue #24 2021-07-09 11:23:07 +01:00
Ken Barker
c861e682cb Change set_wait_event to take Event reference. 2021-04-18 11:43:45 +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
e882ed8762 Add from_device_type method for Context. 2021-04-11 10:26:18 +01:00
Ken Barker
ba39c61041 Redesign Context for issue #12 2021-04-10 17:06:19 +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
jsatka
00f13fcb23 Add Buffer phantom type parameter. 2021-01-14 19:50:04 +02:00
Ken Barker
2598083a6e Don't raise error if device is not SVM capable 2021-01-12 11:57:28 +00:00
Ken Barker
5f6ca54818 Create opencl2_kernel_test.rs 2021-01-12 11:22:39 +00:00
Ken Barker
51bb6d4b26 Remove event_wait_list from the enqueue_nd_range method.
Add event_wait_list to ExecuteKernel so that it can be set like the other enqueue_nd_range_kernel parameters.
2021-01-12 10:13:15 +00:00
Ken Barker
7a5daf1b12 Update integration_test.rs
Calculate kernel execution duration and make SVM test SVM specific not OpenCL 2.
2021-01-04 09:13:17 +00:00
Ken Barker
21aa567ed2 Remove create_svm_vec from Context. 2021-01-03 16:21:27 +00:00
Ken Barker
fd976c8300 Remove memory objects and samplers from Context. 2021-01-03 15:10:05 +00:00
Ken Barker
a13aa8dfc0 Change create_svm_vec interface. 2021-01-03 13:04:23 +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