- Notifications
You must be signed in to change notification settings - Fork4
Package vecf32 provides common functions and methods for slices of float32
License
gorgonia/vecf32
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Package vecf32 provides common functions and methods for slices of float32
go get -u gorgonia.org/vecf32
This packagemath32. For testing this package usestestify/assert, which is licenced with aMIT/BSD-like licence
The point of this package is to provide operations that are accelerated by SIMD. However, this pakcage by default does not use SIMD. To use SIMD, build tags must be used. The supported build tags aresse
andavx
. Here's an example on how to use them:
This is mainly done to eliminate bounds checking in a loop. The idea is the bounds of the slice is checked early on, and if need be, panics early. Then if everything is normal, there won't be bounds checking while in the loop. This also means thatb
must be at leastlen(a)
, otherwise a panic will occur.
To check for boundschecking and bounds check elimination (an amazing feature that landed in Go 1.7), compile your programs with-gcflags='-d=ssa/check_bce/debug=1'
.
Contributions are welcome. The typical process works like this:
- File an issue on the topic you want to contribute
- Fork this repo
- Add your contribution
- Make a pull request
- The pull request will be merged once tests pass, and code reviewed.
- Add your name (if it hasn't already been added to CONTRIBUTORS.md)
This package is very well tested. Please ensure tests are written if any new features are added. If bugs are fixed, please add the bugs to the tests as well.
Package vecf32 is licenced under the MIT licence.
About
Package vecf32 provides common functions and methods for slices of float32