#opencl #vector

archived ocl-core-vector

OpenCL-compatible vector primitive types

2 releases

Uses old Rust 2015

0.1.1 Aug 30, 2022
0.1.0 Apr 11, 2017

#394 in Operating systems

Download history 686/week @ 2023-08-13 485/week @ 2023-08-20 499/week @ 2023-08-27 591/week @ 2023-09-03 559/week @ 2023-09-10 737/week @ 2023-09-17 551/week @ 2023-09-24 622/week @ 2023-10-01 909/week @ 2023-10-08 1137/week @ 2023-10-15 1049/week @ 2023-10-22 1111/week @ 2023-10-29 1141/week @ 2023-11-05 954/week @ 2023-11-12 1094/week @ 2023-11-19 933/week @ 2023-11-26

4,296 downloads per month
Used in 53 crates (2 directly)


653 lines


OpenCL-compatible vector primitive types.


Easy interoperability with ndarray.


OpenCL scalar and vector primitive types.

Primitives may have subtly different behaviour within Rust as they do within kernels. Wrapping is one example of this. Scalar integers within Rust may do overflow checks where in the kernel they do not. Therefore two slightly different implementations of the scalar types are provided in addition to a corresponding vector type for each.

The cl_... (cl_uchar, cl_int, cl_float, etc.) types found in the main ocl-core library are simple aliases of the Rust built-in primitive types and therefore always behave exactly the same way. The uppercase-named types (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.) may be considered. Create an issue if you have an opinion on the matter.

[NOTE]: This module may be renamed.