| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.CodeGen.ImpCode.Kernels
Description
Common definitions for imperative code augmented with the ability to launch kernels.
Synopsis
- type KernelName = Name
- data KernelArg
- type HostCode = Code HostOp
- data HostOp
- data Bookkeeping
- bookkeepingSize :: Bookkeeping -> Integer
- data KernelSafety
- numFailureParams :: KernelSafety -> Int
- data FailureMsg = FailureMsg {}
- type BlockDim = Either Exp KernelConstExp
- data KernelConst
- type KernelConstExp = PrimExp KernelConst
- module Futhark.CodeGen.ImpCode
- module Futhark.IR.GPU.Sizes
Documentation
type KernelName = Name Source #
The name of a kernel.
An argument to be passed to a kernel.
Host-level kernel operation.
Constructors
| LaunchKernel KernelSafety KernelName (Count Bytes (TExp Int64)) [KernelArg] [Exp] [BlockDim] | |
| GetSize VName Name | |
| CmpSizeLe VName Name Exp | |
| GetSizeMax VName SizeClass | |
| GetBookkeeping VName Bookkeeping |
data Bookkeeping Source #
The bookkeeping buffers are device buffers of 32-bit integers that belong to the context and are shared by all kernels. They are zero whenever no kernel is running, and a kernel that uses them must leave them zeroed when it succeeds, and the context zeroes them again after a failure. As kernels run serially, they never compete for them. If we ever add support for multiple streams, we must have a set of buffers per stream.
Constructors
| BookkeepingCounters | Counters, e.g. for detecting the last block to finish. |
| BookkeepingLocks | Locks for operations that cannot be done atomically. |
Instances
| Show Bookkeeping Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU Methods showsPrec :: Int -> Bookkeeping -> ShowS # show :: Bookkeeping -> String # showList :: [Bookkeeping] -> ShowS # | |
| Eq Bookkeeping Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU | |
| Ord Bookkeeping Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU Methods compare :: Bookkeeping -> Bookkeeping -> Ordering # (<) :: Bookkeeping -> Bookkeeping -> Bool # (<=) :: Bookkeeping -> Bookkeeping -> Bool # (>) :: Bookkeeping -> Bookkeeping -> Bool # (>=) :: Bookkeeping -> Bookkeeping -> Bool # max :: Bookkeeping -> Bookkeeping -> Bookkeeping # min :: Bookkeeping -> Bookkeeping -> Bookkeeping # | |
bookkeepingSize :: Bookkeeping -> Integer Source #
The number of 32-bit integers in a bookkeeping buffer.
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. |
Instances
| Show KernelSafety Source # | |
Defined in Futhark.CodeGen.ImpCode.Kernels Methods showsPrec :: Int -> KernelSafety -> ShowS # show :: KernelSafety -> String # showList :: [KernelSafety] -> ShowS # | |
| Eq KernelSafety Source # | |
Defined in Futhark.CodeGen.ImpCode.Kernels | |
| Ord KernelSafety Source # | |
Defined in Futhark.CodeGen.ImpCode.Kernels Methods compare :: KernelSafety -> KernelSafety -> Ordering # (<) :: KernelSafety -> KernelSafety -> Bool # (<=) :: KernelSafety -> KernelSafety -> Bool # (>) :: KernelSafety -> KernelSafety -> Bool # (>=) :: KernelSafety -> KernelSafety -> Bool # max :: KernelSafety -> KernelSafety -> KernelSafety # min :: KernelSafety -> KernelSafety -> KernelSafety # | |
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.
Constructors
| FailureMsg | |
Fields | |
data KernelConst Source #
A run-time constant related to kernels.
Constructors
| SizeConst Name SizeClass | |
| SizeMaxConst SizeClass | |
| SizeUserParam Name KernelConstExp |
Instances
| FreeIn KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU Methods freeIn' :: KernelConst -> FV Source # | |
| Show KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU Methods showsPrec :: Int -> KernelConst -> ShowS # show :: KernelConst -> String # showList :: [KernelConst] -> ShowS # | |
| Eq KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU | |
| Ord KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU Methods compare :: KernelConst -> KernelConst -> Ordering # (<) :: KernelConst -> KernelConst -> Bool # (<=) :: KernelConst -> KernelConst -> Bool # (>) :: KernelConst -> KernelConst -> Bool # (>=) :: KernelConst -> KernelConst -> Bool # max :: KernelConst -> KernelConst -> KernelConst # min :: KernelConst -> KernelConst -> KernelConst # | |
| Pretty KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU | |
type KernelConstExp = PrimExp KernelConst Source #
An expression whose variables are kernel constants.
module Futhark.CodeGen.ImpCode
module Futhark.IR.GPU.Sizes