yarr-0.9.1: Yet another array library

Safe HaskellNone

Data.Yarr.Utils.Primitive

Synopsis

Documentation

class Touchable a whereSource

Mainly used to fight against GHC simplifier, which gives no chance to LLVM to perform Global Value Numbering optimization.

Copied from repa, see http://hackage.haskell.org/packages/archive/repa/3.2.3.1/doc/html/Data-Array-Repa-Eval.html

Methods

touch :: a -> IO ()Source

The function intented to be passed as 3rd parameter to unrolled- functions in Shape class and dim2BlockFill.

If your loading operation is strictly local by elements (in most cases), use noTouch instead of this function.

noTouch :: a -> IO ()Source

Alias to (_ -> return ()).

class PrimitiveOrd a whereSource

GHC simplifier tends to float numeric comparsions as high in execution graph as possible, which in conjunction with loop unrolling sometimes leads to dramatic code bloat.

I'm not sure -M functions work at all, but strict versions defenitely keep comparsions unfloated.

Methods

minM :: a -> a -> IO aSource

Maybe sequential min.

minM' :: a -> a -> IO aSource

Definetely sequential min.

maxM :: a -> a -> IO aSource

Maybe sequential max.

maxM' :: a -> a -> IO aSource

Definetely sequential max.

clampMSource

Arguments

:: a

Min bound

-> a

Max bound

-> a

Value to clamp

-> IO a

Value in bounds | Definetely sequential clamp.

Maybe sequential clamp.

clampM'Source

Arguments

:: a

Min bound

-> a

Max bound

-> a

Value to clamp

-> IO a

Value in bounds