futhark-0.18.2: An optimising compiler for a functional, array-oriented language.
Safe HaskellTrustworthy
LanguageHaskell2010

Futhark.IR.Kernels.Sizes

Description

In the context of this module, a "size" is any kind of tunable (run-time) constant.

Synopsis

Documentation

data SizeClass Source #

The class of some kind of configurable size. Each class may impose constraints on the valid values.

Constructors

SizeThreshold KernelPath (Maybe Int64)

A threshold with an optional default.

SizeGroup 
SizeNumGroups 
SizeTile 
SizeLocalMemory

Likely not useful on its own, but querying the maximum can be handy.

SizeBespoke Name Int64

A bespoke size with a default.

Instances

Instances details
Eq SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Ord SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Show SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Generic SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Associated Types

type Rep SizeClass :: Type -> Type #

Pretty SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

ppr :: SizeClass -> Doc #

pprPrec :: Int -> SizeClass -> Doc #

pprList :: [SizeClass] -> Doc #

SexpIso SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

type Rep SizeClass Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

type Rep SizeClass = D1 ('MetaData "SizeClass" "Futhark.IR.Kernels.Sizes" "futhark-0.18.2-inplace" 'False) ((C1 ('MetaCons "SizeThreshold" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 KernelPath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int64))) :+: (C1 ('MetaCons "SizeGroup" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SizeNumGroups" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "SizeTile" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SizeLocalMemory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SizeBespoke" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))))

sizeDefault :: SizeClass -> Maybe Int64 Source #

The default value for the size. If Nothing, that means the backend gets to decide.

type KernelPath = [(Name, Bool)] Source #

An indication of which comparisons have been performed to get to this point, as well as the result of each comparison.

newtype Count u e Source #

A wrapper supporting a phantom type for indicating what we are counting.

Constructors

Count 

Fields

Instances

Instances details
Functor (Count u) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

fmap :: (a -> b) -> Count u a -> Count u b #

(<$) :: a -> Count u b -> Count u a #

Foldable (Count u) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

fold :: Monoid m => Count u m -> m #

foldMap :: Monoid m => (a -> m) -> Count u a -> m #

foldMap' :: Monoid m => (a -> m) -> Count u a -> m #

foldr :: (a -> b -> b) -> b -> Count u a -> b #

foldr' :: (a -> b -> b) -> b -> Count u a -> b #

foldl :: (b -> a -> b) -> b -> Count u a -> b #

foldl' :: (b -> a -> b) -> b -> Count u a -> b #

foldr1 :: (a -> a -> a) -> Count u a -> a #

foldl1 :: (a -> a -> a) -> Count u a -> a #

toList :: Count u a -> [a] #

null :: Count u a -> Bool #

length :: Count u a -> Int #

elem :: Eq a => a -> Count u a -> Bool #

maximum :: Ord a => Count u a -> a #

minimum :: Ord a => Count u a -> a #

sum :: Num a => Count u a -> a #

product :: Num a => Count u a -> a #

Traversable (Count u) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

traverse :: Applicative f => (a -> f b) -> Count u a -> f (Count u b) #

sequenceA :: Applicative f => Count u (f a) -> f (Count u a) #

mapM :: Monad m => (a -> m b) -> Count u a -> m (Count u b) #

sequence :: Monad m => Count u (m a) -> m (Count u a) #

Eq e => Eq (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

(==) :: Count u e -> Count u e -> Bool #

(/=) :: Count u e -> Count u e -> Bool #

Num e => Num (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

(+) :: Count u e -> Count u e -> Count u e #

(-) :: Count u e -> Count u e -> Count u e #

(*) :: Count u e -> Count u e -> Count u e #

negate :: Count u e -> Count u e #

abs :: Count u e -> Count u e #

signum :: Count u e -> Count u e #

fromInteger :: Integer -> Count u e #

Ord e => Ord (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

compare :: Count u e -> Count u e -> Ordering #

(<) :: Count u e -> Count u e -> Bool #

(<=) :: Count u e -> Count u e -> Bool #

(>) :: Count u e -> Count u e -> Bool #

(>=) :: Count u e -> Count u e -> Bool #

max :: Count u e -> Count u e -> Count u e #

min :: Count u e -> Count u e -> Count u e #

Show e => Show (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

showsPrec :: Int -> Count u e -> ShowS #

show :: Count u e -> String #

showList :: [Count u e] -> ShowS #

Generic (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Associated Types

type Rep (Count u e) :: Type -> Type #

Methods

from :: Count u e -> Rep (Count u e) x #

to :: Rep (Count u e) x -> Count u e #

Pretty e => Pretty (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

ppr :: Count u e -> Doc #

pprPrec :: Int -> Count u e -> Doc #

pprList :: [Count u e] -> Doc #

SexpIso e => SexpIso (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

sexpIso :: SexpGrammar (Count u e) #

IntegralExp e => IntegralExp (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

quot :: Count u e -> Count u e -> Count u e Source #

rem :: Count u e -> Count u e -> Count u e Source #

div :: Count u e -> Count u e -> Count u e Source #

mod :: Count u e -> Count u e -> Count u e Source #

sgn :: Count u e -> Maybe Int Source #

divUp :: Count u e -> Count u e -> Count u e Source #

FreeIn e => FreeIn (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

freeIn' :: Count u e -> FV Source #

Substitute e => Substitute (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

Methods

substituteNames :: Map VName VName -> Count u e -> Count u e Source #

type Rep (Count u e) Source # 
Instance details

Defined in Futhark.IR.Kernels.Sizes

type Rep (Count u e) = D1 ('MetaData "Count" "Futhark.IR.Kernels.Sizes" "futhark-0.18.2-inplace" 'True) (C1 ('MetaCons "Count" 'PrefixI 'True) (S1 ('MetaSel ('Just "unCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 e)))

data NumGroups Source #

Phantom type for the number of groups of some kernel.

data GroupSize Source #

Phantom type for the group size of some kernel.

data NumThreads Source #

Phantom type for number of threads.