Created
March 14, 2021 18:02
-
-
Save LucianoPAlmeida/a5a4874c8fec5e62dd45e5458ab6a50b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias Vec4 = (Int8, Int8, Int8, Int8) | |
@inline(__always) | |
func vecAdd(x: inout ContiguousArray<Vec4>, s: Int8) { | |
for i in 0..<x.count { | |
x[i].0 &+= s | |
x[i].1 &+= s | |
x[i].2 &+= s | |
x[i].3 &+= s | |
} | |
} | |
@inline(__always) | |
func vecAddSIMD(x: inout ContiguousArray<SIMD4<Int8>>, s: Int8) { | |
for i in 0..<x.count { | |
x[i] &+= s | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment