#opencl #gpu #gpgpu #ffi #api

sys opencl-sys

OpenCL C FFI bindings for the Rust programming language

8 releases

0.2.6 Nov 5, 2023
0.2.5 Nov 4, 2023
0.2.4 Sep 17, 2022
0.2.2 Jul 23, 2022
0.1.0 Nov 10, 2017

#292 in Asynchronous

Download history 603/week @ 2023-08-14 342/week @ 2023-08-21 390/week @ 2023-08-28 567/week @ 2023-09-04 472/week @ 2023-09-11 551/week @ 2023-09-18 764/week @ 2023-09-25 718/week @ 2023-10-02 671/week @ 2023-10-09 844/week @ 2023-10-16 896/week @ 2023-10-23 975/week @ 2023-10-30 1181/week @ 2023-11-06 849/week @ 2023-11-13 752/week @ 2023-11-20 861/week @ 2023-11-27

3,743 downloads per month
Used in 27 crates (5 directly)



crates.io docs.io OpenCL 3.0 License Rust

OpenCL C FFI bindings for the Rust programming language.


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

The API for OpenCL versions and extensions are controlled by Rust features such as "CL_VERSION_2_0" and "cl_khr_gl_sharing". To enable an OpenCL version, the feature for that version and all previous OpenCL versions must be enabled, e.g. for "CL_VERSION_2_0"; "CL_VERSION_1_1" and "CL_VERSION_1_2" must also be enabled.

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" 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.


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.


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.