Module ocl::prm [] [src]

OpenCL scalar and vector primitive types.

Rust primitives may have subtly different behaviour than OpenCL primitives within kernels. Wrapping is one example of this. Scalar integers within Rust may do overflow checks where in the kernel they do not. Therefore OpenCL-compatible implementations of each of the types are provided so that host and device side operations can be perfectly consistent.

The cl_... (cl_uchar, cl_int, cl_float, etc.) types are simple aliases of the Rust built-in primitive types and do not behave the same way that the kernel-side equivalents do. The uppercase-named types, on the other hand, (Uchar, Int, Float, etc.) are designed to behave identically to their corresponding types within kernels.

Please file an issue if any of the uppercase-named kernel-mimicking types deviate from what they should (as they are reasonably new this is definitely something to watch out for).

Vector type fields can be accessed using index operations i.e. [0], [1], [2] ... etc. Plans for other ways of accessing fields (such as .x(), .y(), .s0(), .s15(), etc.) will be considered in the future (pending a number of additions/stabilizations to the Rust language). Create an issue if you have an opinion on the matter.

[NOTE]: This module may be renamed.

Structs

Char
Char2
Char3
Char4
Char8
Char16
Double
Double2
Double3
Double4
Double8
Double16
Float
Float2
Float3
Float4
Float8
Float16
Int
Int2
Int3
Int4
Int8
Int16
Long
Long2
Long3
Long4
Long8
Long16
Short
Short2
Short3
Short4
Short8
Short16
Uchar
Uchar2
Uchar3
Uchar4
Uchar8
Uchar16
Uint
Uint2
Uint3
Uint4
Uint8
Uint16
Ulong
Ulong2
Ulong3
Ulong4
Ulong8
Ulong16
Ushort
Ushort2
Ushort3
Ushort4
Ushort8
Ushort16

Type Definitions

cl_GLenum
cl_GLint
cl_GLuint
cl_bitfield
cl_bool
cl_char
cl_double
cl_float
cl_half
cl_int
cl_long
cl_short
cl_uchar
cl_uint
cl_ulong
cl_ushort