Vector SIMD types in Swift

I was wondering if it is possible to use the SIMD types defined in <simd/simd.h> (e.g. vector_float3 ) in Swift. I can’t figure out how to do this.

Thanks!

+5
source share
3 answers

Just for this question to be relevant - SIMD Vectors were announced at WWDC '15 for Swift 2.0:

SIMD support: Clang extended vectors are imported and used in Swift, which allows you to use many graphics and other low-level numeric APIs (for example, simd.h) that you can use in Swift.

So, the answer is now - yes, it is possible.

+3
source

It seems not yet. However, they can add it to a later version. https://groups.google.com/forum/#!topic/swift-language/slwe62yKsWo

+1
source

Check my repo here: https://github.com/noxytrux/SwiftGeom I am creating a whole library for this. Now you can use vec2, vec3 etc. In his quick project.

0
source

Source: https://habr.com/ru/post/1202016/


All Articles