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

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.IR.Syntax.Core

Contents

- Types
- Entry point information
- Attributes
- Values
- Abstract syntax tree
- Flat (LMAD) slices

Description

The most primitive ("core") aspects of the AST. Split out of Futhark.IR.Syntax in order for Futhark.IR.Rep to use these definitions. This module is re-exported from Futhark.IR.Syntax and there should be no reason to include it explicitly.

Synopsis

- module Language.Futhark.Core
- module Language.Futhark.Primitive
- data Commutativity
  - = Noncommutative
  - | Commutative
- data Uniqueness
  - = Nonunique
  - | Unique
- newtype ShapeBase d = Shape {
  - shapeDims :: [d]
  }
- type Shape = ShapeBase SubExp
- stripDims :: Int -> ShapeBase d -> ShapeBase d
- data Ext a
  - = Ext Int
  - | Free a
- type ExtSize = Ext SubExp
- type ExtShape = ShapeBase ExtSize
- newtype Rank = Rank Int
- class (Monoid a, Eq a, Ord a) => ArrayShape a where
  - shapeRank :: a -> Int
  - subShapeOf :: a -> a -> Bool
- data Space
  - = DefaultSpace
  - | Space SpaceId
  - | ScalarSpace [SubExp] PrimType
- type SpaceId = String
- data TypeBase shape u
  - = Prim PrimType
  - | Acc VName Shape [Type] u
  - | Array PrimType shape u
  - | Mem Space
- type Type = TypeBase Shape NoUniqueness
- type ExtType = TypeBase ExtShape NoUniqueness
- type DeclType = TypeBase Shape Uniqueness
- type DeclExtType = TypeBase ExtShape Uniqueness
- data Diet
  - = Consume
  - | Observe
  - | ObservePrim
- newtype ErrorMsg a = ErrorMsg [ErrorMsgPart a]
- data ErrorMsgPart a
  - = ErrorString Text
  - | ErrorVal PrimType a
- errorMsgArgTypes :: ErrorMsg a -> [PrimType]
- data ValueType = ValueType Signedness Rank PrimType
- data OpaqueType
  - = OpaqueType [ValueType]
  - | OpaqueRecord [(Name, EntryPointType)]
  - | OpaqueSum [ValueType] [(Name, [(EntryPointType, [Int])])]
  - | OpaqueArray Int Name [ValueType]
  - | OpaqueRecordArray Int Name [(Name, EntryPointType)]
- newtype OpaqueTypes = OpaqueTypes [(Name, OpaqueType)]
- data Signedness
  - = Unsigned
  - | Signed
- data EntryPointType
  - = TypeOpaque Name
  - | TypeTransparent ValueType
- data Attr
  - = AttrName Name
  - | AttrInt Integer
  - | AttrComp Name [Attr]
- newtype Attrs = Attrs {
  - unAttrs :: Set Attr
  }
- oneAttr :: Attr -> Attrs
- inAttrs :: Attr -> Attrs -> Bool
- withoutAttrs :: Attrs -> Attrs -> Attrs
- mapAttrs :: (Attr -> a) -> Attrs -> [a]
- data PrimValue
  - = IntValue !IntValue
  - | FloatValue !FloatValue
  - | BoolValue !Bool
  - | UnitValue
- data Ident = Ident {
  - identName :: VName
  - identType :: Type
  }
- newtype Certs = Certs {
  - unCerts :: [VName]
  }
- data SubExp
  - = Constant PrimValue
  - | Var VName
- data Param dec = Param {
  - paramAttrs :: Attrs
  - paramName :: VName
  - paramDec :: dec
  }
- data DimIndex d
  - = DimFix d
  - | DimSlice d d d
- newtype Slice d = Slice {
  - unSlice :: [DimIndex d]
  }
- dimFix :: DimIndex d -> Maybe d
- sliceIndices :: Slice d -> Maybe [d]
- sliceDims :: Slice d -> [d]
- sliceShape :: Slice d -> ShapeBase d
- unitSlice :: Num d => d -> d -> DimIndex d
- fixSlice :: Num d => Slice d -> [d] -> [d]
- sliceSlice :: Num d => Slice d -> Slice d -> Slice d
- data PatElem dec = PatElem {
  - patElemName :: VName
  - patElemDec :: dec
  }
- data FlatSlice d = FlatSlice d [FlatDimIndex d]
- data FlatDimIndex d = FlatDimIndex d d
- flatSliceDims :: FlatSlice d -> [d]
- flatSliceStrides :: FlatSlice d -> [d]

# Documentation

module Language.Futhark.Core

module Language.Futhark.Primitive

# Types

data Commutativity Source #

Whether some operator is commutative or not. The `Monoid` instance returns the least commutative of its arguments.

Constructors

Noncommutative |
Commutative |

#### Instances

Instances details

Monoid Commutativity Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: Commutativity Source # mappend :: Commutativity -> Commutativity -> Commutativity Source # mconcat :: [Commutativity] -> Commutativity Source #
Semigroup Commutativity Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: Commutativity -> Commutativity -> Commutativity Source # sconcat :: NonEmpty Commutativity -> Commutativity Source # stimes :: Integral b => b -> Commutativity -> Commutativity Source #
Show Commutativity Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Commutativity -> ShowS Source # show :: Commutativity -> String Source # showList :: [Commutativity] -> ShowS Source #
Eq Commutativity Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Commutativity -> Commutativity -> Bool Source # (/=) :: Commutativity -> Commutativity -> Bool Source #
Ord Commutativity Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Commutativity -> Commutativity -> Ordering Source #

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

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

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

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

max :: Commutativity -> Commutativity -> Commutativity Source #

min :: Commutativity -> Commutativity -> Commutativity Source #

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

data Uniqueness Source #

The uniqueness attribute of a type. This essentially indicates whether or not in-place modifications are acceptable. With respect to ordering, `Unique` is greater than `Nonunique`.

Constructors

Nonunique | May have references outside current function.
Unique | No references outside current function.

#### Instances

Instances details

Monoid Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods mempty :: Uniqueness Source # mappend :: Uniqueness -> Uniqueness -> Uniqueness Source # mconcat :: [Uniqueness] -> Uniqueness Source #
Semigroup Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods (<>) :: Uniqueness -> Uniqueness -> Uniqueness Source # sconcat :: NonEmpty Uniqueness -> Uniqueness Source # stimes :: Integral b => b -> Uniqueness -> Uniqueness Source #
Show Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods showsPrec :: Int -> Uniqueness -> ShowS Source # show :: Uniqueness -> String Source # showList :: [Uniqueness] -> ShowS Source #
DeclExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declExtTypeOf :: DeclExtType -> DeclExtType Source #
DeclTyped DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declTypeOf :: DeclType -> DeclType Source #
ExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: DeclExtType -> ExtType Source #
Typed DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: DeclType -> Type Source #
IsRetType FunReturns Source # |
Instance details Defined in Futhark.IR.Mem Methods primRetType :: PrimType -> FunReturns Source # applyRetType :: Typed dec => [FunReturns] -> [Param dec] -> [(SubExp, Type)] -> Maybe [FunReturns] Source #
IsRetType DeclExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source #
ASTMappable ResRetType Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> ResRetType -> m ResRetType Source #
Eq Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods (==) :: Uniqueness -> Uniqueness -> Bool Source # (/=) :: Uniqueness -> Uniqueness -> Bool Source #
Ord Uniqueness Source # |

Instance details

Defined in Language.Futhark.Core

Methods

compare :: Uniqueness -> Uniqueness -> Ordering Source #

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

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

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

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

max :: Uniqueness -> Uniqueness -> Uniqueness Source #

min :: Uniqueness -> Uniqueness -> Uniqueness Source #

Pretty Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods pretty :: Uniqueness -> Doc ann Source # prettyList :: [Uniqueness] -> Doc ann Source #
Simplifiable [FunReturns] Source # |
Instance details Defined in Futhark.IR.Mem Methods simplify :: SimplifiableRep rep => [FunReturns] -> SimpleM rep [FunReturns] Source #
ASTMappable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeBase Size Uniqueness -> m (TypeBase Size Uniqueness) Source #
Substitutable (RetTypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size Uniqueness -> RetTypeBase Size Uniqueness Source #
Substitutable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> TypeBase Size Uniqueness -> TypeBase Size Uniqueness Source #
FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declExtTypeOf :: MemInfo ExtSize Uniqueness ret -> DeclExtType Source #
DeclTyped (MemInfo SubExp Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declTypeOf :: MemInfo SubExp Uniqueness ret -> DeclType Source #
FixExt ret => ExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods extTypeOf :: MemInfo ExtSize Uniqueness ret -> ExtType Source #
Typed (MemInfo SubExp Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods typeOf :: MemInfo SubExp Uniqueness ret -> Type Source #

newtype ShapeBase d Source #

The size of an array type as a list of its dimension sizes, with the type of sizes being parametric.

Constructors

Shape |

Fields

- shapeDims :: [d]

#### Instances

Instances details

Foldable ShapeBase Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => ShapeBase m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> ShapeBase a -> b Source #

foldr' :: (a -> b -> b) -> b -> ShapeBase a -> b Source #

foldl :: (b -> a -> b) -> b -> ShapeBase a -> b Source #

foldl' :: (b -> a -> b) -> b -> ShapeBase a -> b Source #

foldr1 :: (a -> a -> a) -> ShapeBase a -> a Source #

foldl1 :: (a -> a -> a) -> ShapeBase a -> a Source #

toList :: ShapeBase a -> [a] Source #

null :: ShapeBase a -> Bool Source #

length :: ShapeBase a -> Int Source #

elem :: Eq a => a -> ShapeBase a -> Bool Source #

maximum :: Ord a => ShapeBase a -> a Source #

minimum :: Ord a => ShapeBase a -> a Source #

sum :: Num a => ShapeBase a -> a Source #

product :: Num a => ShapeBase a -> a Source #

Traversable ShapeBase Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> ShapeBase a -> f (ShapeBase b) Source # sequenceA :: Applicative f => ShapeBase (f a) -> f (ShapeBase a) Source # mapM :: Monad m => (a -> m b) -> ShapeBase a -> m (ShapeBase b) Source # sequence :: Monad m => ShapeBase (m a) -> m (ShapeBase a) Source #
Functor ShapeBase Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> ShapeBase a -> ShapeBase b Source # (<$) :: a -> ShapeBase b -> ShapeBase a Source #
DeclExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declExtTypeOf :: DeclExtType -> DeclExtType Source #
DeclTyped DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declTypeOf :: DeclType -> DeclType Source #
ExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: DeclExtType -> ExtType Source #
ExtTyped ExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: ExtType -> ExtType Source #
Typed DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: DeclType -> Type Source #
Typed Type Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: Type -> Type Source #
IsBodyType ExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primBodyType :: PrimType -> ExtType Source #
IsRetType DeclExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source #
Pretty ExtShape Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: ExtShape -> Doc ann Source # prettyList :: [ExtShape] -> Doc ann Source #
Pretty Shape Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Shape -> Doc ann Source # prettyList :: [Shape] -> Doc ann Source #
Monoid (ShapeBase d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: ShapeBase d Source # mappend :: ShapeBase d -> ShapeBase d -> ShapeBase d Source # mconcat :: [ShapeBase d] -> ShapeBase d Source #
Semigroup (ShapeBase d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: ShapeBase d -> ShapeBase d -> ShapeBase d Source # sconcat :: NonEmpty (ShapeBase d) -> ShapeBase d Source # stimes :: Integral b => b -> ShapeBase d -> ShapeBase d Source #
Show d => Show (ShapeBase d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> ShapeBase d -> ShowS Source # show :: ShapeBase d -> String Source # showList :: [ShapeBase d] -> ShowS Source #
FreeIn d => FreeIn (ShapeBase d) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: ShapeBase d -> FV Source #
FixExt d => FixExt (ShapeBase d) Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods fixExt :: Int -> SubExp -> ShapeBase d -> ShapeBase d Source # mapExt :: (Int -> Int) -> ShapeBase d -> ShapeBase d Source #
ArrayShape (ShapeBase ExtSize) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase ExtSize -> Int Source # subShapeOf :: ShapeBase ExtSize -> ShapeBase ExtSize -> Bool Source #
ArrayShape (ShapeBase SubExp) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase SubExp -> Int Source # subShapeOf :: ShapeBase SubExp -> ShapeBase SubExp -> Bool Source #
Simplifiable d => Simplifiable (ShapeBase d) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => ShapeBase d -> SimpleM rep (ShapeBase d) Source #
Rename d => Rename (ShapeBase d) Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: ShapeBase d -> RenameM (ShapeBase d) Source #
Substitute d => Substitute (ShapeBase d) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> ShapeBase d -> ShapeBase d Source #
Eq d => Eq (ShapeBase d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: ShapeBase d -> ShapeBase d -> Bool Source # (/=) :: ShapeBase d -> ShapeBase d -> Bool Source #
Ord d => Ord (ShapeBase d) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: ShapeBase d -> ShapeBase d -> Ordering Source #

(<) :: ShapeBase d -> ShapeBase d -> Bool Source #

(<=) :: ShapeBase d -> ShapeBase d -> Bool Source #

(>) :: ShapeBase d -> ShapeBase d -> Bool Source #

(>=) :: ShapeBase d -> ShapeBase d -> Bool Source #

max :: ShapeBase d -> ShapeBase d -> ShapeBase d Source #

min :: ShapeBase d -> ShapeBase d -> ShapeBase d Source #

Pretty u => Pretty (TypeBase ExtShape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase ExtShape u -> Doc ann Source # prettyList :: [TypeBase ExtShape u] -> Doc ann Source #
Pretty u => Pretty (TypeBase Shape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase Shape u -> Doc ann Source # prettyList :: [TypeBase Shape u] -> Doc ann Source #

type Shape = ShapeBase SubExp Source #

The size of an array as a list of subexpressions. If a variable, that variable must be in scope where this array is used.

stripDims :: Int -> ShapeBase d -> ShapeBase d Source #

`stripDims n shape` strips the outer `n` dimensions from `shape`.

data Ext a Source #

Something that may be existential.

Constructors

Ext Int |
Free a |

#### Instances

Instances details

Foldable Ext Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => Ext m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> Ext a -> b Source #

foldr' :: (a -> b -> b) -> b -> Ext a -> b Source #

foldl :: (b -> a -> b) -> b -> Ext a -> b Source #

foldl' :: (b -> a -> b) -> b -> Ext a -> b Source #

foldr1 :: (a -> a -> a) -> Ext a -> a Source #

foldl1 :: (a -> a -> a) -> Ext a -> a Source #

toList :: Ext a -> [a] Source #

null :: Ext a -> Bool Source #

length :: Ext a -> Int Source #

elem :: Eq a => a -> Ext a -> Bool Source #

maximum :: Ord a => Ext a -> a Source #

minimum :: Ord a => Ext a -> a Source #

sum :: Num a => Ext a -> a Source #

product :: Num a => Ext a -> a Source #

Traversable Ext Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> Ext a -> f (Ext b) Source # sequenceA :: Applicative f => Ext (f a) -> f (Ext a) Source # mapM :: Monad m => (a -> m b) -> Ext a -> m (Ext b) Source # sequence :: Monad m => Ext (m a) -> m (Ext a) Source #
Functor Ext Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> Ext a -> Ext b Source # (<$) :: a -> Ext b -> Ext a Source #
DeclExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declExtTypeOf :: DeclExtType -> DeclExtType Source #
ExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: DeclExtType -> ExtType Source #
ExtTyped ExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: ExtType -> ExtType Source #
FixExt ExtSize Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods fixExt :: Int -> SubExp -> ExtSize -> ExtSize Source # mapExt :: (Int -> Int) -> ExtSize -> ExtSize Source #
IsBodyType BodyReturns Source # |
Instance details Defined in Futhark.IR.Mem Methods primBodyType :: PrimType -> BodyReturns Source #
IsBodyType ExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primBodyType :: PrimType -> ExtType Source #
IsRetType FunReturns Source # |
Instance details Defined in Futhark.IR.Mem Methods primRetType :: PrimType -> FunReturns Source # applyRetType :: Typed dec => [FunReturns] -> [Param dec] -> [(SubExp, Type)] -> Maybe [FunReturns] Source #
IsRetType DeclExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source #
Simplifiable ExtSize Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => ExtSize -> SimpleM rep ExtSize Source #
Rename ExtSize Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: ExtSize -> RenameM ExtSize Source #
Pretty ExtShape Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: ExtShape -> Doc ann Source # prettyList :: [ExtShape] -> Doc ann Source #
Show a => Show (Ext a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Ext a -> ShowS Source # show :: Ext a -> String Source # showList :: [Ext a] -> ShowS Source #
FreeIn d => FreeIn (Ext d) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Ext d -> FV Source #
ArrayShape (ShapeBase ExtSize) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase ExtSize -> Int Source # subShapeOf :: ShapeBase ExtSize -> ShapeBase ExtSize -> Bool Source #
Simplifiable [FunReturns] Source # |
Instance details Defined in Futhark.IR.Mem Methods simplify :: SimplifiableRep rep => [FunReturns] -> SimpleM rep [FunReturns] Source #
Substitute d => Substitute (Ext d) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Ext d -> Ext d Source #
Eq a => Eq (Ext a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Ext a -> Ext a -> Bool Source # (/=) :: Ext a -> Ext a -> Bool Source #
Ord a => Ord (Ext a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Ext a -> Ext a -> Ordering Source # (<) :: Ext a -> Ext a -> Bool Source # (<=) :: Ext a -> Ext a -> Bool Source # (>) :: Ext a -> Ext a -> Bool Source # (>=) :: Ext a -> Ext a -> Bool Source # max :: Ext a -> Ext a -> Ext a Source # min :: Ext a -> Ext a -> Ext a Source #
Pretty a => Pretty (Ext a) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Ext a -> Doc ann Source # prettyList :: [Ext a] -> Doc ann Source #
Pretty u => Pretty (TypeBase ExtShape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase ExtShape u -> Doc ann Source # prettyList :: [TypeBase ExtShape u] -> Doc ann Source #
FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declExtTypeOf :: MemInfo ExtSize Uniqueness ret -> DeclExtType Source #
FixExt ret => ExtTyped (MemInfo ExtSize NoUniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods extTypeOf :: MemInfo ExtSize NoUniqueness ret -> ExtType Source #
FixExt ret => ExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods extTypeOf :: MemInfo ExtSize Uniqueness ret -> ExtType Source #
FixExt ret => FixExt (MemInfo ExtSize u ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods fixExt :: Int -> SubExp -> MemInfo ExtSize u ret -> MemInfo ExtSize u ret Source # mapExt :: (Int -> Int) -> MemInfo ExtSize u ret -> MemInfo ExtSize u ret Source #

type ExtSize = Ext SubExp Source #

The size of this dimension.

type ExtShape = ShapeBase ExtSize Source #

Like `Shape` but some of its elements may be bound in a local environment instead. These are denoted with integral indices.

newtype Rank Source #

The size of an array type as merely the number of dimensions, with no further information.

Constructors

Rank Int |

#### Instances

Instances details

Monoid Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: Rank Source # mappend :: Rank -> Rank -> Rank Source # mconcat :: [Rank] -> Rank Source #
Semigroup Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: Rank -> Rank -> Rank Source # sconcat :: NonEmpty Rank -> Rank Source # stimes :: Integral b => b -> Rank -> Rank Source #
Show Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Rank -> ShowS Source # show :: Rank -> String Source # showList :: [Rank] -> ShowS Source #
ArrayShape Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: Rank -> Int Source # subShapeOf :: Rank -> Rank -> Bool Source #
Rename Rank Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: Rank -> RenameM Rank Source #
Substitute Rank Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Rank -> Rank Source #
Eq Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Rank -> Rank -> Bool Source # (/=) :: Rank -> Rank -> Bool Source #
Ord Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Rank -> Rank -> Ordering Source # (<) :: Rank -> Rank -> Bool Source # (<=) :: Rank -> Rank -> Bool Source # (>) :: Rank -> Rank -> Bool Source # (>=) :: Rank -> Rank -> Bool Source # max :: Rank -> Rank -> Rank Source # min :: Rank -> Rank -> Rank Source #
Pretty Rank Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Rank -> Doc ann Source # prettyList :: [Rank] -> Doc ann Source #
Pretty u => Pretty (TypeBase Rank u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase Rank u -> Doc ann Source # prettyList :: [TypeBase Rank u] -> Doc ann Source #

class (Monoid a, Eq a, Ord a) => ArrayShape a where Source #

A class encompassing types containing array shape information.

Methods

shapeRank :: a -> Int Source #

Return the rank of an array with the given size.

subShapeOf :: a -> a -> Bool Source #

Check whether one shape if a subset of another shape.

#### Instances

Instances details

ArrayShape Rank Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: Rank -> Int Source # subShapeOf :: Rank -> Rank -> Bool Source #
ArrayShape (ShapeBase ExtSize) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase ExtSize -> Int Source # subShapeOf :: ShapeBase ExtSize -> ShapeBase ExtSize -> Bool Source #
ArrayShape (ShapeBase SubExp) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase SubExp -> Int Source # subShapeOf :: ShapeBase SubExp -> ShapeBase SubExp -> Bool Source #

data Space Source #

The memory space of a block. If `DefaultSpace`, this is the "default" space, whatever that is. The exact meaning of the `SpaceId` depends on the backend used. In GPU kernels, for example, this is used to distinguish between constant, global and shared memory spaces. In GPU-enabled host code, it is used to distinguish between host memory (`DefaultSpace`) and GPU space.

Constructors

DefaultSpace |
Space SpaceId |
ScalarSpace [SubExp] PrimType | A special kind of memory that is a statically sized array of some primitive type. Used for private memory on GPUs.

#### Instances

Instances details

Show Space Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Space -> ShowS Source # show :: Space -> String Source # showList :: [Space] -> ShowS Source #
FreeIn Space Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Space -> FV Source #
Simplifiable Space Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => Space -> SimpleM rep Space Source #
Eq Space Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Space -> Space -> Bool Source # (/=) :: Space -> Space -> Bool Source #
Ord Space Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Space -> Space -> Ordering Source # (<) :: Space -> Space -> Bool Source # (<=) :: Space -> Space -> Bool Source # (>) :: Space -> Space -> Bool Source # (>=) :: Space -> Space -> Bool Source # max :: Space -> Space -> Space Source # min :: Space -> Space -> Space Source #
Pretty Space Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Space -> Doc ann Source # prettyList :: [Space] -> Doc ann Source #

type SpaceId = String Source #

A string representing a specific non-default memory space.

data TypeBase shape u Source #

The type of a value. When comparing types for equality with `==`, shapes must match.

Constructors

Prim PrimType |
Acc VName Shape [Type] u | Token, index space, element type, and uniqueness.
Array PrimType shape u |
Mem Space |

#### Instances

Instances details

Bifoldable TypeBase Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods bifold :: Monoid m => TypeBase m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> TypeBase a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> TypeBase a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> TypeBase a b -> c Source #
Bifunctor TypeBase Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods bimap :: (a -> b) -> (c -> d) -> TypeBase a c -> TypeBase b d Source # first :: (a -> b) -> TypeBase a c -> TypeBase b c Source # second :: (b -> c) -> TypeBase a b -> TypeBase a c Source #
Bitraversable TypeBase Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> TypeBase a b -> f (TypeBase c d) Source #
DeclExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declExtTypeOf :: DeclExtType -> DeclExtType Source #
DeclTyped DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declTypeOf :: DeclType -> DeclType Source #
ExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: DeclExtType -> ExtType Source #
ExtTyped ExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: ExtType -> ExtType Source #
Typed DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: DeclType -> Type Source #
Typed Type Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: Type -> Type Source #
IsBodyType ExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primBodyType :: PrimType -> ExtType Source #
IsRetType DeclExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source #
Foldable (TypeBase shape) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => TypeBase shape m -> m Source #

foldMap :: Monoid m => (a -> m) -> TypeBase shape a -> m Source #

foldMap' :: Monoid m => (a -> m) -> TypeBase shape a -> m Source #

foldr :: (a -> b -> b) -> b -> TypeBase shape a -> b Source #

foldr' :: (a -> b -> b) -> b -> TypeBase shape a -> b Source #

foldl :: (b -> a -> b) -> b -> TypeBase shape a -> b Source #

foldl' :: (b -> a -> b) -> b -> TypeBase shape a -> b Source #

foldr1 :: (a -> a -> a) -> TypeBase shape a -> a Source #

foldl1 :: (a -> a -> a) -> TypeBase shape a -> a Source #

toList :: TypeBase shape a -> [a] Source #

null :: TypeBase shape a -> Bool Source #

length :: TypeBase shape a -> Int Source #

elem :: Eq a => a -> TypeBase shape a -> Bool Source #

maximum :: Ord a => TypeBase shape a -> a Source #

minimum :: Ord a => TypeBase shape a -> a Source #

sum :: Num a => TypeBase shape a -> a Source #

product :: Num a => TypeBase shape a -> a Source #

Traversable (TypeBase shape) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> TypeBase shape a -> f (TypeBase shape b) Source # sequenceA :: Applicative f => TypeBase shape (f a) -> f (TypeBase shape a) Source # mapM :: Monad m => (a -> m b) -> TypeBase shape a -> m (TypeBase shape b) Source # sequence :: Monad m => TypeBase shape (m a) -> m (TypeBase shape a) Source #
Functor (TypeBase shape) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> TypeBase shape a -> TypeBase shape b Source # (<$) :: a -> TypeBase shape b -> TypeBase shape a Source #
(Show shape, Show u) => Show (TypeBase shape u) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> TypeBase shape u -> ShowS Source # show :: TypeBase shape u -> String Source # showList :: [TypeBase shape u] -> ShowS Source #
FreeIn shape => FreeIn (TypeBase shape u) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: TypeBase shape u -> FV Source #
(FixExt shape, ArrayShape shape) => FixExt (TypeBase shape u) Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods fixExt :: Int -> SubExp -> TypeBase shape u -> TypeBase shape u Source # mapExt :: (Int -> Int) -> TypeBase shape u -> TypeBase shape u Source #
Simplifiable shape => Simplifiable (TypeBase shape u) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => TypeBase shape u -> SimpleM rep (TypeBase shape u) Source #
Rename shape => Rename (TypeBase shape u) Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: TypeBase shape u -> RenameM (TypeBase shape u) Source #
Substitute shape => Substitute (TypeBase shape u) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> TypeBase shape u -> TypeBase shape u Source #
(Eq shape, Eq u) => Eq (TypeBase shape u) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: TypeBase shape u -> TypeBase shape u -> Bool Source # (/=) :: TypeBase shape u -> TypeBase shape u -> Bool Source #
(Ord shape, Ord u) => Ord (TypeBase shape u) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: TypeBase shape u -> TypeBase shape u -> Ordering Source #

(<) :: TypeBase shape u -> TypeBase shape u -> Bool Source #

(<=) :: TypeBase shape u -> TypeBase shape u -> Bool Source #

(>) :: TypeBase shape u -> TypeBase shape u -> Bool Source #

(>=) :: TypeBase shape u -> TypeBase shape u -> Bool Source #

max :: TypeBase shape u -> TypeBase shape u -> TypeBase shape u Source #

min :: TypeBase shape u -> TypeBase shape u -> TypeBase shape u Source #

Pretty u => Pretty (TypeBase ExtShape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase ExtShape u -> Doc ann Source # prettyList :: [TypeBase ExtShape u] -> Doc ann Source #
Pretty u => Pretty (TypeBase Rank u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase Rank u -> Doc ann Source # prettyList :: [TypeBase Rank u] -> Doc ann Source #
Pretty u => Pretty (TypeBase Shape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase Shape u -> Doc ann Source # prettyList :: [TypeBase Shape u] -> Doc ann Source #

type Type = TypeBase Shape NoUniqueness Source #

A type with shape information, used for describing the type of variables.

type ExtType = TypeBase ExtShape NoUniqueness Source #

A type with existentially quantified shapes - used as part of function (and function-like) return types. Generally only makes sense when used in a list.

type DeclType = TypeBase Shape Uniqueness Source #

A type with shape and uniqueness information, used declaring return- and parameters types.

type DeclExtType = TypeBase ExtShape Uniqueness Source #

An `ExtType` with uniqueness information, used for function return types.

data Diet Source #

Information about which parts of a value/type are consumed. For example, we might say that a function taking three arguments of types `([int], *[int], [int])` has diet `[Observe, Consume, Observe]`.

Constructors

Consume | Consumes this value.
Observe | Only observes value in this position, does not consume. A result may alias this.
ObservePrim | As `Observe`, but the result will not alias, because the parameter does not carry aliases.

#### Instances

Instances details

Show Diet Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Diet -> ShowS Source # show :: Diet -> String Source # showList :: [Diet] -> ShowS Source #
Eq Diet Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Diet -> Diet -> Bool Source # (/=) :: Diet -> Diet -> Bool Source #
Ord Diet Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Diet -> Diet -> Ordering Source # (<) :: Diet -> Diet -> Bool Source # (<=) :: Diet -> Diet -> Bool Source # (>) :: Diet -> Diet -> Bool Source # (>=) :: Diet -> Diet -> Bool Source # max :: Diet -> Diet -> Diet Source # min :: Diet -> Diet -> Diet Source #

newtype ErrorMsg a Source #

An error message is a list of error parts, which are concatenated to form the final message.

Constructors

ErrorMsg [ErrorMsgPart a] |

#### Instances

Instances details

Foldable ErrorMsg Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => ErrorMsg m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> ErrorMsg a -> b Source #

foldr' :: (a -> b -> b) -> b -> ErrorMsg a -> b Source #

foldl :: (b -> a -> b) -> b -> ErrorMsg a -> b Source #

foldl' :: (b -> a -> b) -> b -> ErrorMsg a -> b Source #

foldr1 :: (a -> a -> a) -> ErrorMsg a -> a Source #

foldl1 :: (a -> a -> a) -> ErrorMsg a -> a Source #

toList :: ErrorMsg a -> [a] Source #

null :: ErrorMsg a -> Bool Source #

length :: ErrorMsg a -> Int Source #

elem :: Eq a => a -> ErrorMsg a -> Bool Source #

maximum :: Ord a => ErrorMsg a -> a Source #

minimum :: Ord a => ErrorMsg a -> a Source #

sum :: Num a => ErrorMsg a -> a Source #

product :: Num a => ErrorMsg a -> a Source #

Traversable ErrorMsg Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> ErrorMsg a -> f (ErrorMsg b) Source # sequenceA :: Applicative f => ErrorMsg (f a) -> f (ErrorMsg a) Source # mapM :: Monad m => (a -> m b) -> ErrorMsg a -> m (ErrorMsg b) Source # sequence :: Monad m => ErrorMsg (m a) -> m (ErrorMsg a) Source #
Functor ErrorMsg Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> ErrorMsg a -> ErrorMsg b Source # (<$) :: a -> ErrorMsg b -> ErrorMsg a Source #
IsString (ErrorMsg a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fromString :: String -> ErrorMsg a Source #
Monoid (ErrorMsg a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: ErrorMsg a Source # mappend :: ErrorMsg a -> ErrorMsg a -> ErrorMsg a Source # mconcat :: [ErrorMsg a] -> ErrorMsg a Source #
Semigroup (ErrorMsg a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: ErrorMsg a -> ErrorMsg a -> ErrorMsg a Source # sconcat :: NonEmpty (ErrorMsg a) -> ErrorMsg a Source # stimes :: Integral b => b -> ErrorMsg a -> ErrorMsg a Source #
Show a => Show (ErrorMsg a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> ErrorMsg a -> ShowS Source # show :: ErrorMsg a -> String Source # showList :: [ErrorMsg a] -> ShowS Source #
Eq a => Eq (ErrorMsg a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: ErrorMsg a -> ErrorMsg a -> Bool Source # (/=) :: ErrorMsg a -> ErrorMsg a -> Bool Source #
Ord a => Ord (ErrorMsg a) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: ErrorMsg a -> ErrorMsg a -> Ordering Source #

(<) :: ErrorMsg a -> ErrorMsg a -> Bool Source #

(<=) :: ErrorMsg a -> ErrorMsg a -> Bool Source #

(>) :: ErrorMsg a -> ErrorMsg a -> Bool Source #

(>=) :: ErrorMsg a -> ErrorMsg a -> Bool Source #

max :: ErrorMsg a -> ErrorMsg a -> ErrorMsg a Source #

min :: ErrorMsg a -> ErrorMsg a -> ErrorMsg a Source #

Pretty a => Pretty (ErrorMsg a) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: ErrorMsg a -> Doc ann Source # prettyList :: [ErrorMsg a] -> Doc ann Source #

data ErrorMsgPart a Source #

A part of an error message.

Constructors

ErrorString Text | A literal string.
ErrorVal PrimType a | A run-time value.

#### Instances

Instances details

Foldable ErrorMsgPart Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => ErrorMsgPart m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> ErrorMsgPart a -> b Source #

foldr' :: (a -> b -> b) -> b -> ErrorMsgPart a -> b Source #

foldl :: (b -> a -> b) -> b -> ErrorMsgPart a -> b Source #

foldl' :: (b -> a -> b) -> b -> ErrorMsgPart a -> b Source #

foldr1 :: (a -> a -> a) -> ErrorMsgPart a -> a Source #

foldl1 :: (a -> a -> a) -> ErrorMsgPart a -> a Source #

toList :: ErrorMsgPart a -> [a] Source #

null :: ErrorMsgPart a -> Bool Source #

length :: ErrorMsgPart a -> Int Source #

elem :: Eq a => a -> ErrorMsgPart a -> Bool Source #

maximum :: Ord a => ErrorMsgPart a -> a Source #

minimum :: Ord a => ErrorMsgPart a -> a Source #

sum :: Num a => ErrorMsgPart a -> a Source #

product :: Num a => ErrorMsgPart a -> a Source #

Traversable ErrorMsgPart Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> ErrorMsgPart a -> f (ErrorMsgPart b) Source # sequenceA :: Applicative f => ErrorMsgPart (f a) -> f (ErrorMsgPart a) Source # mapM :: Monad m => (a -> m b) -> ErrorMsgPart a -> m (ErrorMsgPart b) Source # sequence :: Monad m => ErrorMsgPart (m a) -> m (ErrorMsgPart a) Source #
Functor ErrorMsgPart Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> ErrorMsgPart a -> ErrorMsgPart b Source # (<$) :: a -> ErrorMsgPart b -> ErrorMsgPart a Source #
IsString (ErrorMsgPart a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fromString :: String -> ErrorMsgPart a Source #
Show a => Show (ErrorMsgPart a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> ErrorMsgPart a -> ShowS Source # show :: ErrorMsgPart a -> String Source # showList :: [ErrorMsgPart a] -> ShowS Source #
Eq a => Eq (ErrorMsgPart a) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: ErrorMsgPart a -> ErrorMsgPart a -> Bool Source # (/=) :: ErrorMsgPart a -> ErrorMsgPart a -> Bool Source #
Ord a => Ord (ErrorMsgPart a) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: ErrorMsgPart a -> ErrorMsgPart a -> Ordering Source #

(<) :: ErrorMsgPart a -> ErrorMsgPart a -> Bool Source #

(<=) :: ErrorMsgPart a -> ErrorMsgPart a -> Bool Source #

(>) :: ErrorMsgPart a -> ErrorMsgPart a -> Bool Source #

(>=) :: ErrorMsgPart a -> ErrorMsgPart a -> Bool Source #

max :: ErrorMsgPart a -> ErrorMsgPart a -> ErrorMsgPart a Source #

min :: ErrorMsgPart a -> ErrorMsgPart a -> ErrorMsgPart a Source #

errorMsgArgTypes :: ErrorMsg a -> [PrimType] Source #

How many non-constant parts does the error message have, and what is their type?

# Entry point information

data ValueType Source #

An actual non-opaque type that can be passed to and from Futhark programs, or serve as the contents of opaque types. Scalars are represented with zero rank.

Constructors

ValueType Signedness Rank PrimType |

#### Instances

Instances details

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

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: ValueType -> ValueType -> Ordering Source #

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

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

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

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

max :: ValueType -> ValueType -> ValueType Source #

min :: ValueType -> ValueType -> ValueType Source #

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

data OpaqueType Source #

The representation of an opaque type.

Constructors

OpaqueType [ValueType] |
OpaqueRecord [(Name, EntryPointType)] | Note that the field ordering here denote the actual representation - make sure it is preserved.

OpaqueSum [ValueType] [(Name, [(EntryPointType, [Int])])]

Constructor ordering also denotes representation, in that the index of the constructor is the identifying number.

The total values used to represent a sum values is the `ValueType` list. The `Int`s associated with each `EntryPointType` are the indexes of the values used to represent that constructor payload. This is necessary because we deduplicate payloads across constructors.

OpaqueArray Int Name [ValueType] | An array with this rank and named opaque element type.
OpaqueRecordArray Int Name [(Name, EntryPointType)] | An array with known rank and where the elements are this record type.

#### Instances

Instances details

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

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: OpaqueType -> OpaqueType -> Ordering Source #

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

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

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

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

max :: OpaqueType -> OpaqueType -> OpaqueType Source #

min :: OpaqueType -> OpaqueType -> OpaqueType Source #

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

newtype OpaqueTypes Source #

Names of opaque types and their representation.

Constructors

OpaqueTypes [(Name, OpaqueType)] |

#### Instances

Instances details

Monoid OpaqueTypes Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: OpaqueTypes Source # mappend :: OpaqueTypes -> OpaqueTypes -> OpaqueTypes Source # mconcat :: [OpaqueTypes] -> OpaqueTypes Source #
Semigroup OpaqueTypes Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: OpaqueTypes -> OpaqueTypes -> OpaqueTypes Source # sconcat :: NonEmpty OpaqueTypes -> OpaqueTypes Source # stimes :: Integral b => b -> OpaqueTypes -> OpaqueTypes Source #
Show OpaqueTypes Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> OpaqueTypes -> ShowS Source # show :: OpaqueTypes -> String Source # showList :: [OpaqueTypes] -> ShowS Source #
Eq OpaqueTypes Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: OpaqueTypes -> OpaqueTypes -> Bool Source # (/=) :: OpaqueTypes -> OpaqueTypes -> Bool Source #
Ord OpaqueTypes Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: OpaqueTypes -> OpaqueTypes -> Ordering Source #

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

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

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

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

max :: OpaqueTypes -> OpaqueTypes -> OpaqueTypes Source #

min :: OpaqueTypes -> OpaqueTypes -> OpaqueTypes Source #

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

data Signedness Source #

Since the core language does not care for signedness, but the source language does, entry point input/output information has metadata for integer types (and arrays containing these) that indicate whether they are really unsigned integers. This doesn't matter for non-integer types.

Constructors

Unsigned |
Signed |

#### Instances

Instances details

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

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Signedness -> Signedness -> Ordering Source #

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

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

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

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

max :: Signedness -> Signedness -> Signedness Source #

min :: Signedness -> Signedness -> Signedness Source #

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

data EntryPointType Source #

Every entry point argument and return value has an annotation indicating how it maps to the original source program type.

Constructors

TypeOpaque Name | An opaque type of this name.
TypeTransparent ValueType | A transparent type, which is scalar if the rank is zero.

#### Instances

Instances details

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

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: EntryPointType -> EntryPointType -> Ordering Source #

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

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

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

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

max :: EntryPointType -> EntryPointType -> EntryPointType Source #

min :: EntryPointType -> EntryPointType -> EntryPointType Source #

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

# Attributes

data Attr Source #

A single attribute.

Constructors

AttrName Name |
AttrInt Integer |
AttrComp Name [Attr] |

#### Instances

Instances details

IsString Attr Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fromString :: String -> Attr Source #
Show Attr Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Attr -> ShowS Source # show :: Attr -> String Source # showList :: [Attr] -> ShowS Source #
Eq Attr Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Attr -> Attr -> Bool Source # (/=) :: Attr -> Attr -> Bool Source #
Ord Attr Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Attr -> Attr -> Ordering Source # (<) :: Attr -> Attr -> Bool Source # (<=) :: Attr -> Attr -> Bool Source # (>) :: Attr -> Attr -> Bool Source # (>=) :: Attr -> Attr -> Bool Source # max :: Attr -> Attr -> Attr Source # min :: Attr -> Attr -> Attr Source #
Pretty Attr Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Attr -> Doc ann Source # prettyList :: [Attr] -> Doc ann Source #

newtype Attrs Source #

Every statement is associated with a set of attributes, which can have various effects throughout the compiler.

Constructors

Attrs |

Fields

- unAttrs :: Set Attr

#### Instances

Instances details

Monoid Attrs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: Attrs Source # mappend :: Attrs -> Attrs -> Attrs Source # mconcat :: [Attrs] -> Attrs Source #
Semigroup Attrs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: Attrs -> Attrs -> Attrs Source # sconcat :: NonEmpty Attrs -> Attrs Source # stimes :: Integral b => b -> Attrs -> Attrs Source #
Show Attrs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Attrs -> ShowS Source # show :: Attrs -> String Source # showList :: [Attrs] -> ShowS Source #
FreeIn Attrs Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Attrs -> FV Source #
Rename Attrs Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: Attrs -> RenameM Attrs Source #
Substitute Attrs Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Attrs -> Attrs Source #
Eq Attrs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Attrs -> Attrs -> Bool Source # (/=) :: Attrs -> Attrs -> Bool Source #
Ord Attrs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Attrs -> Attrs -> Ordering Source # (<) :: Attrs -> Attrs -> Bool Source # (<=) :: Attrs -> Attrs -> Bool Source # (>) :: Attrs -> Attrs -> Bool Source # (>=) :: Attrs -> Attrs -> Bool Source # max :: Attrs -> Attrs -> Attrs Source # min :: Attrs -> Attrs -> Attrs Source #
Pretty Attrs Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Attrs -> Doc ann Source # prettyList :: [Attrs] -> Doc ann Source #

oneAttr :: Attr -> Attrs Source #

Construct `Attrs` from a single `Attr`.

inAttrs :: Attr -> Attrs -> Bool Source #

Is the given attribute to be found in the attribute set?

withoutAttrs :: Attrs -> Attrs -> Attrs Source #

`x `withoutAttrs` y` gives `x` except for any attributes also in `y`.

mapAttrs :: (Attr -> a) -> Attrs -> [a] Source #

Map a function over an attribute set.

# Values

data PrimValue Source #

Non-array values.

Constructors

IntValue !IntValue |
FloatValue !FloatValue |
BoolValue !Bool |
UnitValue | The only value of type `Unit`.

#### Instances

Instances details

Show PrimValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods showsPrec :: Int -> PrimValue -> ShowS Source # show :: PrimValue -> String Source # showList :: [PrimValue] -> ShowS Source #
IsValue PrimValue Source # |
Instance details Defined in Futhark.IR.Prop.Constants Methods value :: PrimValue -> PrimValue Source #
Eq PrimValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods (==) :: PrimValue -> PrimValue -> Bool Source # (/=) :: PrimValue -> PrimValue -> Bool Source #
Ord PrimValue Source # |

Instance details

Defined in Language.Futhark.Primitive

Methods

compare :: PrimValue -> PrimValue -> Ordering Source #

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

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

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

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

max :: PrimValue -> PrimValue -> PrimValue Source #

min :: PrimValue -> PrimValue -> PrimValue Source #

ToExp PrimValue Source # |
Instance details Defined in Futhark.CodeGen.Backends.SimpleRep Methods toExp :: PrimValue -> SrcLoc -> Exp Source #
Pretty PrimValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods pretty :: PrimValue -> Doc ann Source # prettyList :: [PrimValue] -> Doc ann Source #

# Abstract syntax tree

data Ident Source #

An identifier consists of its name and the type of the value bound to the identifier.

Constructors

Ident |

Fields

- identName :: VName
- identType :: Type

#### Instances

Instances details

Show Ident Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Ident -> ShowS Source # show :: Ident -> String Source # showList :: [Ident] -> ShowS Source #
FreeIn Ident Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Ident -> FV Source #
Typed Ident Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: Ident -> Type Source #
Rename Ident Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: Ident -> RenameM Ident Source #
Substitute Ident Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Ident -> Ident Source #
Eq Ident Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Ident -> Ident -> Bool Source # (/=) :: Ident -> Ident -> Bool Source #
Ord Ident Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Ident -> Ident -> Ordering Source # (<) :: Ident -> Ident -> Bool Source # (<=) :: Ident -> Ident -> Bool Source # (>) :: Ident -> Ident -> Bool Source # (>=) :: Ident -> Ident -> Bool Source # max :: Ident -> Ident -> Ident Source # min :: Ident -> Ident -> Ident Source #
Pretty Ident Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Ident -> Doc ann Source # prettyList :: [Ident] -> Doc ann Source #

newtype Certs Source #

A list of names used for certificates in some expressions.

Constructors

Certs |

Fields

- unCerts :: [VName]

#### Instances

Instances details

Monoid Certs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods mempty :: Certs Source # mappend :: Certs -> Certs -> Certs Source # mconcat :: [Certs] -> Certs Source #
Semigroup Certs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (<>) :: Certs -> Certs -> Certs Source # sconcat :: NonEmpty Certs -> Certs Source # stimes :: Integral b => b -> Certs -> Certs Source #
Show Certs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Certs -> ShowS Source # show :: Certs -> String Source # showList :: [Certs] -> ShowS Source #
FreeIn Certs Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Certs -> FV Source #
Simplifiable Certs Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => Certs -> SimpleM rep Certs Source #
Rename Certs Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: Certs -> RenameM Certs Source #
Substitute Certs Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Certs -> Certs Source #
Eq Certs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Certs -> Certs -> Bool Source # (/=) :: Certs -> Certs -> Bool Source #
Ord Certs Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Certs -> Certs -> Ordering Source # (<) :: Certs -> Certs -> Bool Source # (<=) :: Certs -> Certs -> Bool Source # (>) :: Certs -> Certs -> Bool Source # (>=) :: Certs -> Certs -> Bool Source # max :: Certs -> Certs -> Certs Source # min :: Certs -> Certs -> Certs Source #
Pretty Certs Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Certs -> Doc ann Source # prettyList :: [Certs] -> Doc ann Source #
MonadState (VNameSource, Bool, Certs) (SimpleM rep) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods get :: SimpleM rep (VNameSource, Bool, Certs) Source # put :: (VNameSource, Bool, Certs) -> SimpleM rep () Source # state :: ((VNameSource, Bool, Certs) -> (a, (VNameSource, Bool, Certs))) -> SimpleM rep a Source #

data SubExp Source #

A subexpression is either a scalar constant or a variable. One important property is that evaluation of a subexpression is guaranteed to complete in constant time.

Constructors

Constant PrimValue |
Var VName |

#### Instances

Instances details

Show SubExp Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> SubExp -> ShowS Source # show :: SubExp -> String Source # showList :: [SubExp] -> ShowS Source #
ToExp SubExp Source # |
Instance details Defined in Futhark.CodeGen.ImpGen Methods toExp :: SubExp -> ImpM rep r op Exp Source # toExp' :: PrimType -> SubExp -> Exp Source #
ToExp SubExp Source # |
Instance details Defined in Futhark.Construct Methods toExp :: MonadBuilder m => SubExp -> m (Exp (Rep m)) Source #
HasLetDecMem LetDecMem Source # |
Instance details Defined in Futhark.IR.Mem Methods letDecMem :: LetDecMem -> LetDecMem Source #
FreeIn SubExp Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: SubExp -> FV Source #
DeclExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declExtTypeOf :: DeclExtType -> DeclExtType Source #
DeclTyped DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declTypeOf :: DeclType -> DeclType Source #
ExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: DeclExtType -> ExtType Source #
ExtTyped ExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: ExtType -> ExtType Source #
FixExt ExtSize Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods fixExt :: Int -> SubExp -> ExtSize -> ExtSize Source # mapExt :: (Int -> Int) -> ExtSize -> ExtSize Source #
Typed DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: DeclType -> Type Source #
Typed Type Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: Type -> Type Source #
IsBodyType BodyReturns Source # |
Instance details Defined in Futhark.IR.Mem Methods primBodyType :: PrimType -> BodyReturns Source #
IsBodyType ExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primBodyType :: PrimType -> ExtType Source #
IsRetType FunReturns Source # |
Instance details Defined in Futhark.IR.Mem Methods primRetType :: PrimType -> FunReturns Source # applyRetType :: Typed dec => [FunReturns] -> [Param dec] -> [(SubExp, Type)] -> Maybe [FunReturns] Source #
IsRetType DeclExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source #
Simplifiable ExtSize Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => ExtSize -> SimpleM rep ExtSize Source #
Simplifiable SubExp Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => SubExp -> SimpleM rep SubExp Source #
Rename ExtSize Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: ExtSize -> RenameM ExtSize Source #
Rename SubExp Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: SubExp -> RenameM SubExp Source #
Substitute SubExp Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> SubExp -> SubExp Source #
Eq SubExp Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: SubExp -> SubExp -> Bool Source # (/=) :: SubExp -> SubExp -> Bool Source #
Ord SubExp Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: SubExp -> SubExp -> Ordering Source # (<) :: SubExp -> SubExp -> Bool Source # (<=) :: SubExp -> SubExp -> Bool Source # (>) :: SubExp -> SubExp -> Bool Source # (>=) :: SubExp -> SubExp -> Bool Source # max :: SubExp -> SubExp -> SubExp Source # min :: SubExp -> SubExp -> SubExp Source #
ToExp SubExp Source # |
Instance details Defined in Futhark.CodeGen.Backends.SimpleRep Methods toExp :: SubExp -> SrcLoc -> Exp Source #
Pretty ExtShape Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: ExtShape -> Doc ann Source # prettyList :: [ExtShape] -> Doc ann Source #
Pretty Shape Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Shape -> Doc ann Source # prettyList :: [Shape] -> Doc ann Source #
Pretty SubExp Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: SubExp -> Doc ann Source # prettyList :: [SubExp] -> Doc ann Source #
ArrayShape (ShapeBase ExtSize) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase ExtSize -> Int Source # subShapeOf :: ShapeBase ExtSize -> ShapeBase ExtSize -> Bool Source #
ArrayShape (ShapeBase SubExp) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods shapeRank :: ShapeBase SubExp -> Int Source # subShapeOf :: ShapeBase SubExp -> ShapeBase SubExp -> Bool Source #
Simplifiable [FunReturns] Source # |
Instance details Defined in Futhark.IR.Mem Methods simplify :: SimplifiableRep rep => [FunReturns] -> SimpleM rep [FunReturns] Source #
Pretty u => Pretty (TypeBase ExtShape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase ExtShape u -> Doc ann Source # prettyList :: [TypeBase ExtShape u] -> Doc ann Source #
Pretty u => Pretty (TypeBase Shape u) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: TypeBase Shape u -> Doc ann Source # prettyList :: [TypeBase Shape u] -> Doc ann Source #
FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declExtTypeOf :: MemInfo ExtSize Uniqueness ret -> DeclExtType Source #
DeclTyped (MemInfo SubExp Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declTypeOf :: MemInfo SubExp Uniqueness ret -> DeclType Source #
FixExt ret => ExtTyped (MemInfo ExtSize NoUniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods extTypeOf :: MemInfo ExtSize NoUniqueness ret -> ExtType Source #
FixExt ret => ExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods extTypeOf :: MemInfo ExtSize Uniqueness ret -> ExtType Source #
FixExt ret => FixExt (MemInfo ExtSize u ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods fixExt :: Int -> SubExp -> MemInfo ExtSize u ret -> MemInfo ExtSize u ret Source # mapExt :: (Int -> Int) -> MemInfo ExtSize u ret -> MemInfo ExtSize u ret Source #
Typed (MemInfo SubExp NoUniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods typeOf :: MemInfo SubExp NoUniqueness ret -> Type Source #
Typed (MemInfo SubExp Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods typeOf :: MemInfo SubExp Uniqueness ret -> Type Source #

data Param dec Source #

A function or lambda parameter.

Constructors

Param |

Fields

- paramAttrs :: Attrs

  Attributes of the parameter. When constructing a parameter, feel free to just pass `mempty`.

- paramName :: VName

  Name of the parameter.

- paramDec :: dec

  Function parameter decoration.

#### Instances

Instances details

Foldable Param Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => Param m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> Param a -> b Source #

foldr' :: (a -> b -> b) -> b -> Param a -> b Source #

foldl :: (b -> a -> b) -> b -> Param a -> b Source #

foldl' :: (b -> a -> b) -> b -> Param a -> b Source #

foldr1 :: (a -> a -> a) -> Param a -> a Source #

foldl1 :: (a -> a -> a) -> Param a -> a Source #

toList :: Param a -> [a] Source #

null :: Param a -> Bool Source #

length :: Param a -> Int Source #

elem :: Eq a => a -> Param a -> Bool Source #

maximum :: Ord a => Param a -> a Source #

minimum :: Ord a => Param a -> a Source #

sum :: Num a => Param a -> a Source #

product :: Num a => Param a -> a Source #

Traversable Param Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> Param a -> f (Param b) Source # sequenceA :: Applicative f => Param (f a) -> f (Param a) Source # mapM :: Monad m => (a -> m b) -> Param a -> m (Param b) Source # sequence :: Monad m => Param (m a) -> m (Param a) Source #
Functor Param Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> Param a -> Param b Source # (<$) :: a -> Param b -> Param a Source #
Show dec => Show (Param dec) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Param dec -> ShowS Source # show :: Param dec -> String Source # showList :: [Param dec] -> ShowS Source #
FreeIn dec => FreeIn (Param dec) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Param dec -> FV Source #
DeclTyped dec => DeclTyped (Param dec) Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declTypeOf :: Param dec -> DeclType Source #
Typed dec => Typed (Param dec) Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: Param dec -> Type Source #
Rename dec => Rename (Param dec) Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: Param dec -> RenameM (Param dec) Source #
Substitute dec => Substitute (Param dec) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Param dec -> Param dec Source #
Eq dec => Eq (Param dec) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Param dec -> Param dec -> Bool Source # (/=) :: Param dec -> Param dec -> Bool Source #
Ord dec => Ord (Param dec) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Param dec -> Param dec -> Ordering Source #

(<) :: Param dec -> Param dec -> Bool Source #

(<=) :: Param dec -> Param dec -> Bool Source #

(>) :: Param dec -> Param dec -> Bool Source #

(>=) :: Param dec -> Param dec -> Bool Source #

max :: Param dec -> Param dec -> Param dec Source #

min :: Param dec -> Param dec -> Param dec Source #

Pretty t => Pretty (Param t) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Param t -> Doc ann Source # prettyList :: [Param t] -> Doc ann Source #

data DimIndex d Source #

How to index a single dimension of an array.

Constructors

DimFix d | Fix index in this dimension.
DimSlice d d d | `DimSlice start_offset num_elems stride`.

#### Instances

Instances details

Foldable DimIndex Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => DimIndex m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> DimIndex a -> b Source #

foldr' :: (a -> b -> b) -> b -> DimIndex a -> b Source #

foldl :: (b -> a -> b) -> b -> DimIndex a -> b Source #

foldl' :: (b -> a -> b) -> b -> DimIndex a -> b Source #

foldr1 :: (a -> a -> a) -> DimIndex a -> a Source #

foldl1 :: (a -> a -> a) -> DimIndex a -> a Source #

toList :: DimIndex a -> [a] Source #

null :: DimIndex a -> Bool Source #

length :: DimIndex a -> Int Source #

elem :: Eq a => a -> DimIndex a -> Bool Source #

maximum :: Ord a => DimIndex a -> a Source #

minimum :: Ord a => DimIndex a -> a Source #

sum :: Num a => DimIndex a -> a Source #

product :: Num a => DimIndex a -> a Source #

Traversable DimIndex Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> DimIndex a -> f (DimIndex b) Source # sequenceA :: Applicative f => DimIndex (f a) -> f (DimIndex a) Source # mapM :: Monad m => (a -> m b) -> DimIndex a -> m (DimIndex b) Source # sequence :: Monad m => DimIndex (m a) -> m (DimIndex a) Source #
Functor DimIndex Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> DimIndex a -> DimIndex b Source # (<$) :: a -> DimIndex b -> DimIndex a Source #
Show d => Show (DimIndex d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> DimIndex d -> ShowS Source # show :: DimIndex d -> String Source # showList :: [DimIndex d] -> ShowS Source #
FreeIn d => FreeIn (DimIndex d) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: DimIndex d -> FV Source #
Simplifiable d => Simplifiable (DimIndex d) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => DimIndex d -> SimpleM rep (DimIndex d) Source #
Rename d => Rename (DimIndex d) Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: DimIndex d -> RenameM (DimIndex d) Source #
Substitute d => Substitute (DimIndex d) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> DimIndex d -> DimIndex d Source #
Eq d => Eq (DimIndex d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: DimIndex d -> DimIndex d -> Bool Source # (/=) :: DimIndex d -> DimIndex d -> Bool Source #
Ord d => Ord (DimIndex d) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: DimIndex d -> DimIndex d -> Ordering Source #

(<) :: DimIndex d -> DimIndex d -> Bool Source #

(<=) :: DimIndex d -> DimIndex d -> Bool Source #

(>) :: DimIndex d -> DimIndex d -> Bool Source #

(>=) :: DimIndex d -> DimIndex d -> Bool Source #

max :: DimIndex d -> DimIndex d -> DimIndex d Source #

min :: DimIndex d -> DimIndex d -> DimIndex d Source #

Pretty d => Pretty (DimIndex d) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: DimIndex d -> Doc ann Source # prettyList :: [DimIndex d] -> Doc ann Source #

newtype Slice d Source #

A list of `DimIndex`s, indicating how an array should be sliced. Whenever a function accepts a `Slice`, that slice should be total, i.e, cover all dimensions of the array. Deviators should be indicated by taking a list of `DimIndex`es instead.

Constructors

Slice |

Fields

- unSlice :: [DimIndex d]

#### Instances

Instances details

Foldable Slice Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => Slice m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> Slice a -> b Source #

foldr' :: (a -> b -> b) -> b -> Slice a -> b Source #

foldl :: (b -> a -> b) -> b -> Slice a -> b Source #

foldl' :: (b -> a -> b) -> b -> Slice a -> b Source #

foldr1 :: (a -> a -> a) -> Slice a -> a Source #

foldl1 :: (a -> a -> a) -> Slice a -> a Source #

toList :: Slice a -> [a] Source #

null :: Slice a -> Bool Source #

length :: Slice a -> Int Source #

elem :: Eq a => a -> Slice a -> Bool Source #

maximum :: Ord a => Slice a -> a Source #

minimum :: Ord a => Slice a -> a Source #

sum :: Num a => Slice a -> a Source #

product :: Num a => Slice a -> a Source #

Traversable Slice Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> Slice a -> f (Slice b) Source # sequenceA :: Applicative f => Slice (f a) -> f (Slice a) Source # mapM :: Monad m => (a -> m b) -> Slice a -> m (Slice b) Source # sequence :: Monad m => Slice (m a) -> m (Slice a) Source #
Functor Slice Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> Slice a -> Slice b Source # (<$) :: a -> Slice b -> Slice a Source #
Show d => Show (Slice d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> Slice d -> ShowS Source # show :: Slice d -> String Source # showList :: [Slice d] -> ShowS Source #
FreeIn d => FreeIn (Slice d) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: Slice d -> FV Source #
Simplifiable d => Simplifiable (Slice d) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods simplify :: SimplifiableRep rep => Slice d -> SimpleM rep (Slice d) Source #
Substitute d => Substitute (Slice d) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> Slice d -> Slice d Source #
Eq d => Eq (Slice d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: Slice d -> Slice d -> Bool Source # (/=) :: Slice d -> Slice d -> Bool Source #
Ord d => Ord (Slice d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods compare :: Slice d -> Slice d -> Ordering Source # (<) :: Slice d -> Slice d -> Bool Source # (<=) :: Slice d -> Slice d -> Bool Source # (>) :: Slice d -> Slice d -> Bool Source # (>=) :: Slice d -> Slice d -> Bool Source # max :: Slice d -> Slice d -> Slice d Source # min :: Slice d -> Slice d -> Slice d Source #
Pretty a => Pretty (Slice a) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: Slice a -> Doc ann Source # prettyList :: [Slice a] -> Doc ann Source #

dimFix :: DimIndex d -> Maybe d Source #

If the argument is a `DimFix`, return its component.

sliceIndices :: Slice d -> Maybe [d] Source #

If the slice is all `DimFix`s, return the components.

sliceDims :: Slice d -> [d] Source #

The dimensions of the array produced by this slice.

sliceShape :: Slice d -> ShapeBase d Source #

The shape of the array produced by this slice.

unitSlice :: Num d => d -> d -> DimIndex d Source #

A slice with a stride of one.

fixSlice :: Num d => Slice d -> [d] -> [d] Source #

Fix the `DimSlice`s of a slice. The number of indexes must equal the length of `sliceDims` for the slice.

sliceSlice :: Num d => Slice d -> Slice d -> Slice d Source #

Further slice the `DimSlice`s of a slice. The number of slices must equal the length of `sliceDims` for the slice.

data PatElem dec Source #

An element of a pattern - consisting of a name and an addditional parametric decoration. This decoration is what is expected to contain the type of the resulting variable.

Constructors

PatElem |

Fields

- patElemName :: VName

  The name being bound.

- patElemDec :: dec

  Pat element decoration.

#### Instances

Instances details

Foldable PatElem Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => PatElem m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> PatElem a -> b Source #

foldr' :: (a -> b -> b) -> b -> PatElem a -> b Source #

foldl :: (b -> a -> b) -> b -> PatElem a -> b Source #

foldl' :: (b -> a -> b) -> b -> PatElem a -> b Source #

foldr1 :: (a -> a -> a) -> PatElem a -> a Source #

foldl1 :: (a -> a -> a) -> PatElem a -> a Source #

toList :: PatElem a -> [a] Source #

null :: PatElem a -> Bool Source #

length :: PatElem a -> Int Source #

elem :: Eq a => a -> PatElem a -> Bool Source #

maximum :: Ord a => PatElem a -> a Source #

minimum :: Ord a => PatElem a -> a Source #

sum :: Num a => PatElem a -> a Source #

product :: Num a => PatElem a -> a Source #

Traversable PatElem Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> PatElem a -> f (PatElem b) Source # sequenceA :: Applicative f => PatElem (f a) -> f (PatElem a) Source # mapM :: Monad m => (a -> m b) -> PatElem a -> m (PatElem b) Source # sequence :: Monad m => PatElem (m a) -> m (PatElem a) Source #
Functor PatElem Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> PatElem a -> PatElem b Source # (<$) :: a -> PatElem b -> PatElem a Source #
Show dec => Show (PatElem dec) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> PatElem dec -> ShowS Source # show :: PatElem dec -> String Source # showList :: [PatElem dec] -> ShowS Source #
AliasesOf dec => AliasesOf (PatElem dec) Source # |
Instance details Defined in Futhark.IR.Prop.Aliases Methods aliasesOf :: PatElem dec -> Names Source #
FreeIn dec => FreeIn (PatElem dec) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: PatElem dec -> FV Source #
Typed dec => Typed (PatElem dec) Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods typeOf :: PatElem dec -> Type Source #
Rename dec => Rename (PatElem dec) Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: PatElem dec -> RenameM (PatElem dec) Source #
Substitute dec => Substitute (PatElem dec) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> PatElem dec -> PatElem dec Source #
Eq dec => Eq (PatElem dec) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: PatElem dec -> PatElem dec -> Bool Source # (/=) :: PatElem dec -> PatElem dec -> Bool Source #
Ord dec => Ord (PatElem dec) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: PatElem dec -> PatElem dec -> Ordering Source #

(<) :: PatElem dec -> PatElem dec -> Bool Source #

(<=) :: PatElem dec -> PatElem dec -> Bool Source #

(>) :: PatElem dec -> PatElem dec -> Bool Source #

(>=) :: PatElem dec -> PatElem dec -> Bool Source #

max :: PatElem dec -> PatElem dec -> PatElem dec Source #

min :: PatElem dec -> PatElem dec -> PatElem dec Source #

Pretty t => Pretty (PatElem t) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: PatElem t -> Doc ann Source # prettyList :: [PatElem t] -> Doc ann Source #

# Flat (LMAD) slices

data FlatSlice d Source #

A flat slice is a way of viewing a one-dimensional array as a multi-dimensional array, using a more compressed mechanism than reshaping and using `Slice`. The initial `d` is an offset, and the list then specifies the shape of the resulting array.

Constructors

FlatSlice d [FlatDimIndex d] |

#### Instances

Instances details

Foldable FlatSlice Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => FlatSlice m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> FlatSlice a -> b Source #

foldr' :: (a -> b -> b) -> b -> FlatSlice a -> b Source #

foldl :: (b -> a -> b) -> b -> FlatSlice a -> b Source #

foldl' :: (b -> a -> b) -> b -> FlatSlice a -> b Source #

foldr1 :: (a -> a -> a) -> FlatSlice a -> a Source #

foldl1 :: (a -> a -> a) -> FlatSlice a -> a Source #

toList :: FlatSlice a -> [a] Source #

null :: FlatSlice a -> Bool Source #

length :: FlatSlice a -> Int Source #

elem :: Eq a => a -> FlatSlice a -> Bool Source #

maximum :: Ord a => FlatSlice a -> a Source #

minimum :: Ord a => FlatSlice a -> a Source #

sum :: Num a => FlatSlice a -> a Source #

product :: Num a => FlatSlice a -> a Source #

Traversable FlatSlice Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> FlatSlice a -> f (FlatSlice b) Source # sequenceA :: Applicative f => FlatSlice (f a) -> f (FlatSlice a) Source # mapM :: Monad m => (a -> m b) -> FlatSlice a -> m (FlatSlice b) Source # sequence :: Monad m => FlatSlice (m a) -> m (FlatSlice a) Source #
Functor FlatSlice Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> FlatSlice a -> FlatSlice b Source # (<$) :: a -> FlatSlice b -> FlatSlice a Source #
Show d => Show (FlatSlice d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> FlatSlice d -> ShowS Source # show :: FlatSlice d -> String Source # showList :: [FlatSlice d] -> ShowS Source #
FreeIn d => FreeIn (FlatSlice d) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: FlatSlice d -> FV Source #
Substitute d => Substitute (FlatSlice d) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> FlatSlice d -> FlatSlice d Source #
Eq d => Eq (FlatSlice d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: FlatSlice d -> FlatSlice d -> Bool Source # (/=) :: FlatSlice d -> FlatSlice d -> Bool Source #
Ord d => Ord (FlatSlice d) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: FlatSlice d -> FlatSlice d -> Ordering Source #

(<) :: FlatSlice d -> FlatSlice d -> Bool Source #

(<=) :: FlatSlice d -> FlatSlice d -> Bool Source #

(>) :: FlatSlice d -> FlatSlice d -> Bool Source #

(>=) :: FlatSlice d -> FlatSlice d -> Bool Source #

max :: FlatSlice d -> FlatSlice d -> FlatSlice d Source #

min :: FlatSlice d -> FlatSlice d -> FlatSlice d Source #

Pretty a => Pretty (FlatSlice a) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: FlatSlice a -> Doc ann Source # prettyList :: [FlatSlice a] -> Doc ann Source #

data FlatDimIndex d Source #

A dimension in a `FlatSlice`.

Constructors

FlatDimIndex |

Fields

- d

  Number of elements in dimension

- d

  Stride of dimension

#### Instances

Instances details

Foldable FlatDimIndex Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => FlatDimIndex m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> FlatDimIndex a -> b Source #

foldr' :: (a -> b -> b) -> b -> FlatDimIndex a -> b Source #

foldl :: (b -> a -> b) -> b -> FlatDimIndex a -> b Source #

foldl' :: (b -> a -> b) -> b -> FlatDimIndex a -> b Source #

foldr1 :: (a -> a -> a) -> FlatDimIndex a -> a Source #

foldl1 :: (a -> a -> a) -> FlatDimIndex a -> a Source #

toList :: FlatDimIndex a -> [a] Source #

null :: FlatDimIndex a -> Bool Source #

length :: FlatDimIndex a -> Int Source #

elem :: Eq a => a -> FlatDimIndex a -> Bool Source #

maximum :: Ord a => FlatDimIndex a -> a Source #

minimum :: Ord a => FlatDimIndex a -> a Source #

sum :: Num a => FlatDimIndex a -> a Source #

product :: Num a => FlatDimIndex a -> a Source #

Traversable FlatDimIndex Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods traverse :: Applicative f => (a -> f b) -> FlatDimIndex a -> f (FlatDimIndex b) Source # sequenceA :: Applicative f => FlatDimIndex (f a) -> f (FlatDimIndex a) Source # mapM :: Monad m => (a -> m b) -> FlatDimIndex a -> m (FlatDimIndex b) Source # sequence :: Monad m => FlatDimIndex (m a) -> m (FlatDimIndex a) Source #
Functor FlatDimIndex Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods fmap :: (a -> b) -> FlatDimIndex a -> FlatDimIndex b Source # (<$) :: a -> FlatDimIndex b -> FlatDimIndex a Source #
Show d => Show (FlatDimIndex d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods showsPrec :: Int -> FlatDimIndex d -> ShowS Source # show :: FlatDimIndex d -> String Source # showList :: [FlatDimIndex d] -> ShowS Source #
FreeIn d => FreeIn (FlatDimIndex d) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: FlatDimIndex d -> FV Source #
Substitute d => Substitute (FlatDimIndex d) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> FlatDimIndex d -> FlatDimIndex d Source #
Eq d => Eq (FlatDimIndex d) Source # |
Instance details Defined in Futhark.IR.Syntax.Core Methods (==) :: FlatDimIndex d -> FlatDimIndex d -> Bool Source # (/=) :: FlatDimIndex d -> FlatDimIndex d -> Bool Source #
Ord d => Ord (FlatDimIndex d) Source # |

Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: FlatDimIndex d -> FlatDimIndex d -> Ordering Source #

(<) :: FlatDimIndex d -> FlatDimIndex d -> Bool Source #

(<=) :: FlatDimIndex d -> FlatDimIndex d -> Bool Source #

(>) :: FlatDimIndex d -> FlatDimIndex d -> Bool Source #

(>=) :: FlatDimIndex d -> FlatDimIndex d -> Bool Source #

max :: FlatDimIndex d -> FlatDimIndex d -> FlatDimIndex d Source #

min :: FlatDimIndex d -> FlatDimIndex d -> FlatDimIndex d Source #

Pretty d => Pretty (FlatDimIndex d) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: FlatDimIndex d -> Doc ann Source # prettyList :: [FlatDimIndex d] -> Doc ann Source #

flatSliceDims :: FlatSlice d -> [d] Source #

The dimensions (shape) of the view produced by a flat slice.

flatSliceStrides :: FlatSlice d -> [d] Source #

The strides of each dimension produced by a flat slice.