ocl_core_vector/
lib.rs

1//! OpenCL scalar and vector primitive types.
2//!
3//! Primitives may have subtly different behaviour within Rust as they do
4//! within kernels. Wrapping is one example of this. Scalar integers
5//! within Rust may do overflow checks where in the kernel they do not.
6//! Therefore two slightly different implementations of the scalar types
7//! are provided in addition to a corresponding vector type for each.
8//!
9//! The `cl_...` (`cl_uchar`, `cl_int`, `cl_float`, etc.) types found in the
10//! main `ocl-core` library are simple aliases of the Rust built-in primitive
11//! types and therefore always behave exactly the same way. The
12//! uppercase-named types (`Uchar`, `Int`, `Float`, etc.) are designed to
13//! behave identically to their corresponding types within kernels.
14//!
15//! Please file an issue if any of the uppercase-named kernel-mimicking
16//! types deviate from what they should (as they are reasonably new this
17//! is definitely something to watch out for).
18//!
19//! Vector type fields can be accessed using index operations i.e. [0],
20//! [1], [2] ... etc. Plans for other ways of accessing fields (such as
21//! `.x()`, `.y()`, `.s0()`, `.s15()`, etc.) may be considered. Create an
22//! issue if you have an opinion on the matter.
23//!
24//! [NOTE]: This module may be renamed.
25
26extern crate num_traits;
27
28mod vectors;
29
30pub use self::vectors::{
31    Char, Char2, Char3, Char4, Char8, Char16,
32    Uchar, Uchar2, Uchar3, Uchar4, Uchar8, Uchar16,
33    Short, Short2, Short3, Short4, Short8, Short16,
34    Ushort, Ushort2, Ushort3, Ushort4, Ushort8, Ushort16,
35    Int, Int2, Int3, Int4, Int8, Int16,
36    Uint, Uint2, Uint3, Uint4, Uint8, Uint16,
37    Long, Long2, Long3, Long4, Long8, Long16,
38    Ulong, Ulong2, Ulong3, Ulong4, Ulong8, Ulong16,
39    Float, Float2, Float3, Float4, Float8, Float16,
40    Double, Double2, Double3, Double4, Double8, Double16,
41};