3 ms·
> Basically, I wanted a set of functions that would allow me to perform simd operations on slices. How is this actually used though? I searched the whole artic
by umvi 2y ago
> Basically, I wanted a set of functions that would allow me to perform simd operations on slices.
How is this actually used though? I searched the whole article, and no where are any operations being performed on slices.
Edit: I found what I was looking for in the linked docs: https://pkg.go.dev/github.com/pehringer/simd#pkg-index https://pkg.go.dev/github.com/pehringer/simd#pkg-index
So basically if you have 2 slices you want to add together, instead of a for loop you could do it in parallel with simd using:
simd.AddInt32(slice1, slice2, result)
- pehringer 2y agoI should have added some examples in the docs / repo :( checkout the benchmark code at the bottom of this file for an example: https://github.com/pehringer/simd/blob/main/simd_test.go https://github.com/pehringer/simd/blob/main/simd_test.go