I was wondering if it's possible to use the SIMD types defined in <simd/simd.h>
(such as vector_float3
) in Swift. I can't seem to figure out a way to do it.
Thanks!
A vector is an instruction operand containing a set of data elements packed into a one-dimensional array. The elements can be integer or floating-point values. Most Vector/SIMD Multimedia Extension and SPU instructions operate on vector operands.
Overview. A vector is comparable to a fixed-length array containing integer or floating-point values. The simd framework provides support for small vectors, that is, vectors that contain up to eight double-precision or sixteen single-precision values.
Just a heads up for this question for it to be up to date - SIMD Vectors have been announced at WWDC '15 for Swift 2.0:
SIMD Support:Clang extended vectors are imported and usable in Swift, enabling many graphics and other low-level numeric APIs (e.g. simd.h) to be usable in Swift.
So the answer from now on - yes, it's possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With