Crate opencl_sys
source ·Expand description
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.
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
” 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.
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:
- a Linux package manager, e.g.,
sudo apt-get install intel-opencl-icd
- or a Windows download and install from https://www.intel.com/content/www/us/en/developer/articles/technical/intel-cpu-runtime-for-opencl-applications-with-sycl-support.html
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.
Modules§
- FFI bindings for cl_d3d10.h
cl_d3d10.h
containsOpenCL
extensions that provide interoperability withDirect3D
10.
OpenCL
extensions are documented in the OpenCL-Registry - FFI bindings for cl_d3d11.h
cl_d3d11.h
containsOpenCL
extensions that provide interoperability withDirect3D
11.
OpenCL
extensions are documented in the OpenCL-Registry - FFI bindings for cl_dx9_media_sharing.h
cl_dx9_media_sharing.h
containsOpenCL
extensions that provide interoperability withDirect3D
9.
OpenCL
extensions are documented in the OpenCL-Registry - FFI bindings for cl_function_types.h
- FFI bindings for cl_icd.h
- FFI bindings for cl_layer.h
Structs§
Constants§
- New property to clGetDeviceInfo for retrieving supported intermediate languages.
- Index of layer in a multilayer hardware buffer
- Index of plane in a multiplanar hardware buffer
- Data consistency with host property
- Import memory size value to indicate a size for the whole buffer.
- Android hardware buffer type value for
CL_IMPORT_TYPE_ARM
property - Default and valid properties name for
cl_arm_import_memory
- DMA BUF memory type value for
CL_IMPORT_TYPE_ARM
property - Host process memory type default value for
CL_IMPORT_TYPE_ARM
property - Protected memory property
- New property to clGetProgramInfo for retrieving for retrieving the IL of a program.
Functions§
- clCreateFromGLTexture2D⚠Deprecated
- clCreateFromGLTexture3D⚠Deprecated
- clCreateImage2D⚠Deprecated
- clCreateImage3D⚠Deprecated
- clEnqueueBarrier⚠Deprecated
- clEnqueueMarker⚠Deprecated
- clEnqueueWaitForEvents⚠Deprecated
- clGetExtensionFunctionAddress⚠Deprecated
- clUnloadCompiler⚠Deprecated