yarr-1.4.0.2: Yet another array library

Safe HaskellNone
LanguageHaskell98

Data.Yarr.Utils.Primitive

Synopsis

Documentation

class Touchable a where Source #

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

Minimal complete definition

touch

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.

Instances

Touchable Bool Source # 

Methods

touch :: Bool -> IO () Source #

Touchable Double Source # 

Methods

touch :: Double -> IO () Source #

Touchable Float Source # 

Methods

touch :: Float -> IO () Source #

Touchable Int Source # 

Methods

touch :: Int -> IO () Source #

Touchable Int8 Source # 

Methods

touch :: Int8 -> IO () Source #

Touchable Int16 Source # 

Methods

touch :: Int16 -> IO () Source #

Touchable Int32 Source # 

Methods

touch :: Int32 -> IO () Source #

Touchable Int64 Source # 

Methods

touch :: Int64 -> IO () Source #

Touchable Word Source # 

Methods

touch :: Word -> IO () Source #

Touchable Word8 Source # 

Methods

touch :: Word8 -> IO () Source #

Touchable Word16 Source # 

Methods

touch :: Word16 -> IO () Source #

Touchable Word32 Source # 

Methods

touch :: Word32 -> IO () Source #

Touchable Word64 Source # 

Methods

touch :: Word64 -> IO () Source #

(Vector v e, Touchable e) => Touchable (v e) Source # 

Methods

touch :: v e -> IO () Source #

noTouch :: a -> IO () Source #

Alias to (\_ -> return ()).

class PrimitiveOrd a where Source #

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.

Minimal complete definition

minM, minM', maxM, maxM', clampM, clampM'

Methods

minM :: a -> a -> IO a Source #

Maybe sequential min.

minM' :: a -> a -> IO a Source #

Definetely sequential min.

maxM :: a -> a -> IO a Source #

Maybe sequential max.

maxM' :: a -> a -> IO a Source #

Definetely sequential max.

clampM :: a -> a -> a -> IO a Source #

Maybe sequential clamp.

clampM' :: a -> a -> a -> IO a Source #

Definetely sequential clamp.

Instances

PrimitiveOrd Char Source # 
PrimitiveOrd Double Source # 
PrimitiveOrd Float Source # 
PrimitiveOrd Int Source # 

Methods

minM :: Int -> Int -> IO Int Source #

minM' :: Int -> Int -> IO Int Source #

maxM :: Int -> Int -> IO Int Source #

maxM' :: Int -> Int -> IO Int Source #

clampM :: Int -> Int -> Int -> IO Int Source #

clampM' :: Int -> Int -> Int -> IO Int Source #

PrimitiveOrd Word Source #