#opencl #gpu #api-bindings #gpgpu #api #extension #resources

sys no-std opencl-sys

OpenCL C FFI bindings for the Rust programming language

13 releases

0.3.1 Apr 4, 2024
0.3.0 Mar 30, 2024
0.2.9 Mar 29, 2024
0.2.8 Dec 22, 2023
0.1.0 Nov 10, 2017

#594 in Graphics APIs

Download history 340/week @ 2024-07-19 457/week @ 2024-07-26 520/week @ 2024-08-02 333/week @ 2024-08-09 523/week @ 2024-08-16 306/week @ 2024-08-23 566/week @ 2024-08-30 650/week @ 2024-09-06 1106/week @ 2024-09-13 1048/week @ 2024-09-20 334/week @ 2024-09-27 357/week @ 2024-10-04 389/week @ 2024-10-11 300/week @ 2024-10-18 328/week @ 2024-10-25 725/week @ 2024-11-01

1,799 downloads per month
Used in 29 crates (6 directly)

Apache-2.0

320KB
6.5K SLoC

crates.io docs.io OpenCL 3.0 License Rust

OpenCL C FFI bindings for the Rust programming language.

Description

Rust FFI Bindings to the Khronos OpenCL C language headers, see the OpenCL Resource Guide.

OpenCL Packages
OpenCL Packages

The API for OpenCL versions and extensions are controlled by Rust features such as "CL_VERSION_2_0" and "cl_khr_gl_sharing".
The default features are "CL_VERSION_1_1" and "CL_VERSION_1_2".

Rust deprecation warnings are given for OpenCL API functions that are deprecated by an enabled OpenCL version e.g., clCreateCommandQueue is deprecated whenever "CL_VERSION_2_0" (or above) is enabled.

The Rust FFI files attempt to match the format and layout of the original C source files instead of bindgen output files to ease maintenance.

bindgen ../OpenCL-Headers/CL/opencl.h -o opencl.rs -- -I ../OpenCL-Headers/CL

The library is declared no_std.

Use

OpenCL requires that an appropriate OpenCL hardware driver(s) and an OpenCL Installable Client Driver (ICD) are installed.
OpenCL GPU hardware driver(s) are installed with graphics drivers by the main manufacturers: Nvidia, AMD and Intel.
However, an OpenCL ICD must usually be installed manually by:

Note: you do not need to install an OpenCL ICD from the same manufacturer as your hardware.
In general the more up to date the OpenCL ICD, the better.

Contribution

If you want to contribute through code or documentation, the Contributing guide is the best place to start.
If you have any questions, please feel free to ask. Just please abide by our Code of Conduct.

License

Licensed under the Apache License, Version 2.0, as per Khronos Group OpenCL.
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

OpenCL and the OpenCL logo are trademarks of Apple Inc. used under license by Khronos.

Dependencies