kenba/opencl3

Support for vector data types

Closed this issue · 1 comments

itayw commented

Thanks again for your hard work, amazing library.

I may be missing something, but does the library support vector data types, such as float4? I'm working on a project that could really benefit from being able to pack float4, but cannot find docs or support for it.

itayw commented

Seems I answered my question, so I'll write what I did here for future reference and close.

const ARRAY_SIZE: usize = 8;
let value_array = [std::simd::u64x4::default(); ARRAY_SIZE];

// Create an OpenCL SVM vectora
let mut test_values =
    SvmVec::<std::simd::u64x4>::allocate(&self.context, ARRAY_SIZE).expect("SVM allocation failed");

The above is taken from the example and will use long4.