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

Futhark.IR.GPU.Op

Synopsis

Size operations

data SizeOp Source #

A simple size-level query or computation.

Constructors

SplitSpace SplitOrdering SubExp SubExp SubExp

SplitSpace o w i elems_per_thread.

Computes how to divide array elements to threads in a kernel. Returns the number of elements in the chunk that the current thread should take.

w is the length of the outer dimension in the array. i is the current thread index. Each thread takes at most elems_per_thread elements.

If the order o is SplitContiguous, thread with index i should receive elements i*elems_per_tread, i*elems_per_thread + 1, ..., i*elems_per_thread + (elems_per_thread-1).

If the order o is SplitStrided stride, the thread will receive elements i, i+stride, i+2*stride, ..., i+(elems_per_thread-1)*stride.

GetSize Name SizeClass

Produce some runtime-configurable size.

GetSizeMax SizeClass

The maximum size of some class.

CmpSizeLe Name SizeClass SubExp

Compare size (likely a threshold) with some integer value.

CalcNumGroups SubExp Name SubExp

CalcNumGroups w max_num_groups group_size calculates the number of GPU workgroups to use for an input of the given size. The Name is a size name. Note that w is an i64 to avoid overflow issues.

Instances

Instances details
Eq SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

(==) :: SizeOp -> SizeOp -> Bool #

(/=) :: SizeOp -> SizeOp -> Bool #

Ord SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Show SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Pretty SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

ppr :: SizeOp -> Doc #

pprPrec :: Int -> SizeOp -> Doc #

pprList :: [SizeOp] -> Doc #

TypedOp SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

opType :: HasScope t m => SizeOp -> m [ExtType] Source #

FreeIn SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

freeIn' :: SizeOp -> FV Source #

Substitute SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Rename SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

IsOp SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

AliasedOp SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

OpMetrics SizeOp Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

opMetrics :: SizeOp -> MetricsM () Source #

Host operations

data HostOp rep op Source #

A host-level operation; parameterised by what else it can do.

Constructors

SegOp (SegOp SegLevel rep)

A segmented operation.

SizeOp SizeOp 
OtherOp op 

Instances

Instances details
(RepTypes rep, Eq op) => Eq (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

(==) :: HostOp rep op -> HostOp rep op -> Bool #

(/=) :: HostOp rep op -> HostOp rep op -> Bool #

(RepTypes rep, Ord op) => Ord (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

compare :: HostOp rep op -> HostOp rep op -> Ordering #

(<) :: HostOp rep op -> HostOp rep op -> Bool #

(<=) :: HostOp rep op -> HostOp rep op -> Bool #

(>) :: HostOp rep op -> HostOp rep op -> Bool #

(>=) :: HostOp rep op -> HostOp rep op -> Bool #

max :: HostOp rep op -> HostOp rep op -> HostOp rep op #

min :: HostOp rep op -> HostOp rep op -> HostOp rep op #

(RepTypes rep, Show op) => Show (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

showsPrec :: Int -> HostOp rep op -> ShowS #

show :: HostOp rep op -> String #

showList :: [HostOp rep op] -> ShowS #

(PrettyRep rep, Pretty op) => Pretty (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

ppr :: HostOp rep op -> Doc #

pprPrec :: Int -> HostOp rep op -> Doc #

pprList :: [HostOp rep op] -> Doc #

TypedOp op => TypedOp (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

opType :: HasScope t m => HostOp rep op -> m [ExtType] Source #

(ASTRep rep, FreeIn op) => FreeIn (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

freeIn' :: HostOp rep op -> FV Source #

(ASTRep rep, Substitute op) => Substitute (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

substituteNames :: Map VName VName -> HostOp rep op -> HostOp rep op Source #

(ASTRep rep, Rename op) => Rename (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

rename :: HostOp rep op -> RenameM (HostOp rep op) Source #

(ASTRep rep, IsOp op) => IsOp (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

safeOp :: HostOp rep op -> Bool Source #

cheapOp :: HostOp rep op -> Bool Source #

(CanBeAliased (Op rep), CanBeAliased op, ASTRep rep) => CanBeAliased (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Associated Types

type OpWithAliases (HostOp rep op) Source #

(Aliased rep, AliasedOp op, ASTRep rep) => AliasedOp (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

opAliases :: HostOp rep op -> [Names] Source #

consumedInOp :: HostOp rep op -> Names Source #

(OpMetrics (Op rep), OpMetrics op) => OpMetrics (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

opMetrics :: HostOp rep op -> MetricsM () Source #

(CanBeWise (Op rep), CanBeWise op, ASTRep rep) => CanBeWise (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Associated Types

type OpWithWisdom (HostOp rep op) Source #

Methods

removeOpWisdom :: OpWithWisdom (HostOp rep op) -> HostOp rep op Source #

addOpWisdom :: HostOp rep op -> OpWithWisdom (HostOp rep op) Source #

(ASTRep rep, IndexOp op) => IndexOp (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

indexOp :: (ASTRep rep0, IndexOp (Op rep0)) => SymbolTable rep0 -> Int -> HostOp rep op -> [TPrimExp Int64 VName] -> Maybe Indexed Source #

OpReturns (HostOp (Wise GPUMem) ()) Source # 
Instance details

Defined in Futhark.IR.GPUMem

Methods

opReturns :: (Mem rep inner, Monad m, HasScope rep m) => HostOp (Wise GPUMem) () -> m [ExpReturns] Source #

OpReturns (HostOp GPUMem ()) Source # 
Instance details

Defined in Futhark.IR.GPUMem

Methods

opReturns :: (Mem rep inner, Monad m, HasScope rep m) => HostOp GPUMem () -> m [ExpReturns] Source #

SizeSubst (HostOp rep op) Source # 
Instance details

Defined in Futhark.Pass.ExplicitAllocations.GPU

Methods

opSizeSubst :: PatT dec -> HostOp rep op -> ChunkMap Source #

opIsConst :: HostOp rep op -> Bool Source #

(ASTRep rep, Aliased rep, CSEInOp (Op rep), CSEInOp op) => CSEInOp (HostOp rep op) Source # 
Instance details

Defined in Futhark.Optimise.CSE

Methods

cseInOp :: HostOp rep op -> CSEM rep0 (HostOp rep op)

type OpWithAliases (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

type OpWithAliases (HostOp rep op) = HostOp (Aliases rep) (OpWithAliases op)
type OpWithWisdom (HostOp rep op) Source # 
Instance details

Defined in Futhark.IR.GPU.Op

type OpWithWisdom (HostOp rep op) = HostOp (Wise rep) (OpWithWisdom op)

traverseHostOpStms :: Monad m => OpStmsTraverser m op rep -> OpStmsTraverser m (HostOp rep op) rep Source #

A helper for defining TraverseOpStms.

typeCheckHostOp :: Checkable rep => (SegLevel -> OpWithAliases (Op rep) -> TypeM rep ()) -> Maybe SegLevel -> (op -> TypeM rep ()) -> HostOp (Aliases rep) op -> TypeM rep () Source #

SegOp refinements

data SegLevel Source #

At which level the *body* of a SegOp executes.

Instances

Instances details
Eq SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Ord SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Show SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Pretty SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

ppr :: SegLevel -> Doc #

pprPrec :: Int -> SegLevel -> Doc #

pprList :: [SegLevel] -> Doc #

FreeIn SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Methods

freeIn' :: SegLevel -> FV Source #

Substitute SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Rename SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Simplifiable SegLevel Source # 
Instance details

Defined in Futhark.IR.GPU.Op

Reexports