Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Math.Matrix.SIMD
Contents
Description
This modules provides SIMD optimized versions of vectors. Relies heavily on GHC SIMD support. SIMD works only when using LLVM and GHC 8.x The only combinations of vectors supported are 4 * Int32, 8 * Int16 and 16 * Int8, 4*Float, 2*Double Conversions to and from optimized types and Vector4 Int32, (Vector2 :*: Vector2) Int32, (Vector4 Int16, Vector4 Int16) Vector4 Float, (Vector2 :*: Vector2) Float, and (Vector4 :*: Vector4) Int8 can be performed as appropriate for each type.
Documentation
data SIMDVec (len :: Nat) a Source #
Instances
zipSVec4 :: (Int32 -> Int32 -> Int32) -> SIMDVec 4 Int32 -> SIMDVec 4 Int32 -> SIMDVec 4 Int32 Source #
zipFVec4 :: (Float -> Float -> Float) -> SIMDVec 4 Float -> SIMDVec 4 Float -> SIMDVec 4 Float Source #
zipSVec8 :: (Int16 -> Int16 -> Int16) -> SIMDVec 8 Int16 -> SIMDVec 8 Int16 -> SIMDVec 8 Int16 Source #
zipSVec16 :: (Int8 -> Int8 -> Int8) -> SIMDVec 16 Int8 -> SIMDVec 16 Int8 -> SIMDVec 16 Int8 Source #
makeSVec8 :: Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> Int16 -> SIMDVec 8 Int16 Source #
makeSVec16 :: Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> Int8 -> SIMDVec 16 Int8 Source #
class VectorSpace a => Optimal a where Source #
Methods
toO :: a -> Optimized a Source #
fromO :: Optimized a -> a Source #
zipO :: (Scalar a -> Scalar a -> Scalar a) -> Optimized a -> Optimized a -> Optimized a Source #
mapO :: (Scalar a -> Scalar a) -> Optimized a -> Optimized a Source #
sumCoordinatesO :: Optimized a -> Scalar a Source #
Instances
fast_multiply2_double :: Scalar (SIMDVec 2 Double) ~ Double => Matrix2 Double -> Vector2 Double -> Vector2 Double Source #