futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.IR.GPU.Sizes

Description

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

Synopsis

- data SizeClass
  - = SizeThreshold KernelPath (Maybe Int64)
  - | SizeThreadBlock
  - | SizeGrid
  - | SizeTile
  - | SizeRegTile
  - | SizeSharedMemory
  - | SizeBespoke Name Int64
  - | SizeRegisters
  - | SizeCache
- sizeDefault :: SizeClass -> Maybe Int64
- type KernelPath = [(Name, Bool)]
- newtype Count u e = Count {
  - unCount :: e
  }
- data NumBlocks
- data BlockSize
- data NumThreads

# 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.
SizeThreadBlock |
SizeGrid | The number of thread blocks.
SizeTile |
SizeRegTile |
SizeSharedMemory | Likely not useful on its own, but querying the maximum can be handy.
SizeBespoke Name Int64 | A bespoke size with a default.
SizeRegisters | Amount of registers available per threadblock. Mostly meaningful for querying the maximum.
SizeCache | Amount of L2 cache memory, in bytes. Mostly meaningful for querying the maximum.

#### Instances

Instances details

Show SizeClass Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods showsPrec :: Int -> SizeClass -> ShowS Source # show :: SizeClass -> String Source # showList :: [SizeClass] -> ShowS Source #
Eq SizeClass Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods (==) :: SizeClass -> SizeClass -> Bool Source # (/=) :: SizeClass -> SizeClass -> Bool Source #
Ord SizeClass Source # |

Instance details

Defined in Futhark.IR.GPU.Sizes

Methods

compare :: SizeClass -> SizeClass -> Ordering Source #

(<) :: SizeClass -> SizeClass -> Bool Source #

(<=) :: SizeClass -> SizeClass -> Bool Source #

(>) :: SizeClass -> SizeClass -> Bool Source #

(>=) :: SizeClass -> SizeClass -> Bool Source #

max :: SizeClass -> SizeClass -> SizeClass Source #

min :: SizeClass -> SizeClass -> SizeClass Source #

Pretty SizeClass Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods pretty :: SizeClass -> Doc ann Source # prettyList :: [SizeClass] -> Doc ann Source #

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

- unCount :: e

#### Instances

Instances details

Foldable (Count u) Source # |

Instance details

Defined in Futhark.IR.GPU.Sizes

Methods

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

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

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

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

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

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

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

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

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

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

null :: Count u a -> Bool Source #

length :: Count u a -> Int Source #

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

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

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

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

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

Traversable (Count u) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods traverse :: Applicative f => (a -> f b) -> Count u a -> f (Count u b) Source # sequenceA :: Applicative f => Count u (f a) -> f (Count u a) Source # mapM :: Monad m => (a -> m b) -> Count u a -> m (Count u b) Source # sequence :: Monad m => Count u (m a) -> m (Count u a) Source #
Functor (Count u) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods fmap :: (a -> b) -> Count u a -> Count u b Source # (<$) :: a -> Count u b -> Count u a Source #
Num e => Num (Count u e) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods (+) :: Count u e -> Count u e -> Count u e Source # (-) :: Count u e -> Count u e -> Count u e Source # (*) :: Count u e -> Count u e -> Count u e Source # negate :: Count u e -> Count u e Source # abs :: Count u e -> Count u e Source # signum :: Count u e -> Count u e Source # fromInteger :: Integer -> Count u e Source #
Show e => Show (Count u e) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods showsPrec :: Int -> Count u e -> ShowS Source # show :: Count u e -> String Source # showList :: [Count u e] -> ShowS Source #
FreeIn e => FreeIn (Count u e) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods freeIn' :: Count u e -> FV Source #
Substitute e => Substitute (Count u e) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods substituteNames :: Map VName VName -> Count u e -> Count u e Source #
IntegralExp e => IntegralExp (Count u e) Source # |

Instance details

Defined in Futhark.IR.GPU.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 #

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

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

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

Eq e => Eq (Count u e) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods (==) :: Count u e -> Count u e -> Bool Source # (/=) :: Count u e -> Count u e -> Bool Source #
Ord e => Ord (Count u e) Source # |

Instance details

Defined in Futhark.IR.GPU.Sizes

Methods

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

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

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

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

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

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

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

Pretty e => Pretty (Count u e) Source # |
Instance details Defined in Futhark.IR.GPU.Sizes Methods pretty :: Count u e -> Doc ann Source # prettyList :: [Count u e] -> Doc ann Source #

data NumBlocks Source #

Phantom type for the number of blocks of some kernel.

data BlockSize Source #

Phantom type for the block size of some kernel.

data NumThreads Source #

Phantom type for number of threads.