futhark
Safe HaskellNone
LanguageGHC2021

Futhark.CodeGen.ImpCode.Kernels

Description

Common definitions for imperative code augmented with the ability to launch kernels.

Synopsis

Documentation

type KernelName = Name Source #

The name of a kernel.

data KernelArg Source #

An argument to be passed to a kernel.

Constructors

ValueKArg Exp PrimType

Pass the value of this scalar expression as argument.

MemKArg VName

Pass this pointer as argument.

Instances

Instances details
Show KernelArg Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Kernels

type HostCode = Code HostOp Source #

A piece of code calling kernels.

data HostOp Source #

Host-level kernel operation.

Instances

Instances details
Show HostOp Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Kernels

Pretty HostOp Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Kernels

Methods

pretty :: HostOp -> Doc ann #

prettyList :: [HostOp] -> Doc ann #

data KernelSafety Source #

Information about bounds checks and how sensitive it is to errors. Ordered by least demanding to most.

Constructors

SafetyNone

Does not need to know if we are in a failing state, and also cannot fail.

SafetyCheap

Needs to be told if there's a global failure, and that's it, and cannot fail.

SafetyFull

Needs all parameters, may fail itself.

numFailureParams :: KernelSafety -> Int Source #

How many leading failure arguments we must pass when launching a kernel with these safety characteristics.

data FailureMsg Source #

Something that can go wrong in a kernel. Part of the machinery for reporting error messages from within kernels.

type BlockDim = Either Exp KernelConstExp Source #

The size of one dimension of a block.

type KernelConstExp = PrimExp KernelConst Source #

An expression whose variables are kernel constants.