futhark-0.25.27: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageGHC2021

Futhark.IR.Syntax.Core

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

Documentation

Types

data Commutativity Source #

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

Instances

Instances details
Monoid Commutativity Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Semigroup Commutativity Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show Commutativity Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Eq Commutativity Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Ord Commutativity Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Pretty Commutativity Source # 
Instance details

Defined in Futhark.IR.Pretty

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

Semigroup Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Show Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

DeclExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

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

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

ASTMappable ResRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Ord Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Pretty Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Simplifiable [FunReturns] Source # 
Instance details

Defined in Futhark.IR.Mem

ASTMappable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (RetTypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

DeclTyped (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => ExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Typed (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

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

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

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped ExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

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

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

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

Semigroup (ShapeBase d) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show d => Show (ShapeBase d) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

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

ArrayShape (ShapeBase SubExp) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Simplifiable d => Simplifiable (ShapeBase d) Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Engine

Rename d => Rename (ShapeBase d) Source # 
Instance details

Defined in Futhark.Transform.Rename

Substitute d => Substitute (ShapeBase d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Eq d => Eq (ShapeBase d) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Ord d => Ord (ShapeBase d) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Pretty u => Pretty (TypeBase ExtShape u) Source # 
Instance details

Defined in Futhark.IR.Pretty

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

ExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped ExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

FixExt ExtSize Source # 
Instance details

Defined in Futhark.IR.Prop.Types

IsBodyType BodyReturns Source # 
Instance details

Defined in Futhark.IR.Mem

IsBodyType ExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsRetType FunReturns Source # 
Instance details

Defined in Futhark.IR.Mem

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

Simplifiable ExtSize Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Engine

Rename ExtSize Source # 
Instance details

Defined in Futhark.Transform.Rename

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

Simplifiable [FunReturns] Source # 
Instance details

Defined in Futhark.IR.Mem

Substitute d => Substitute (Ext d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

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

FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => ExtTyped (MemInfo ExtSize NoUniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => ExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

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

Semigroup Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

ArrayShape Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Rename Rank Source # 
Instance details

Defined in Futhark.Transform.Rename

Substitute Rank Source # 
Instance details

Defined in Futhark.Transform.Substitute

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

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.

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

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

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

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

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped ExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

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

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

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

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

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

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

Monoid (ErrorMsg a) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Semigroup (ErrorMsg a) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show a => Show (ErrorMsg a) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

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

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

Show a => Show (ErrorMsgPart a) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Eq a => Eq (ErrorMsgPart a) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Ord a => Ord (ErrorMsgPart a) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

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.

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 Ints 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.

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

Semigroup OpaqueTypes Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show OpaqueTypes Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Eq OpaqueTypes Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Ord OpaqueTypes Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Pretty OpaqueTypes Source # 
Instance details

Defined in Futhark.IR.Pretty

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 

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.

Attributes

data Attr Source #

A single attribute.

Instances

Instances details
IsString Attr Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show Attr Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

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

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

Instances

Instances details
Monoid Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax.Core