module Futhark.Representation.Kernels.Sizes
( SizeClass (..), KernelPath )
where
import Futhark.Util.Pretty
import Language.Futhark.Core (Name)
import Futhark.Representation.AST.Pretty ()
type KernelPath = [(Name, Bool)]
data SizeClass = SizeThreshold KernelPath
| SizeGroup
| SizeNumGroups
| SizeTile
deriving (Eq, Ord, Show)
instance Pretty SizeClass where
ppr (SizeThreshold path) = text $ "threshold (" ++ unwords (map pStep path) ++ ")"
where pStep (v, True) = pretty v
pStep (v, False) = '!' : pretty v
ppr SizeGroup = text "group_size"
ppr SizeNumGroups = text "num_groups"
ppr SizeTile = text "tile_size"