Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Imperative code with an OpenCL component.
Apart from ordinary imperative code, this also carries around an OpenCL program as a string, as well as a list of kernels defined by the OpenCL program.
The imperative code has been augmented with a LaunchKernel
operation that allows one to execute an OpenCL kernel.
Synopsis
- data Program = Program {}
- type KernelName = Name
- data KernelArg
- type CLCode = Code OpenCL
- data OpenCL
- = LaunchKernel KernelSafety KernelName (Count Bytes (TExp Int64)) [KernelArg] [Exp] [BlockDim]
- | GetSize VName Name
- | CmpSizeLe VName Name Exp
- | GetSizeMax VName SizeClass
- data KernelSafety
- numFailureParams :: KernelSafety -> Int
- data KernelTarget
- data FailureMsg = FailureMsg {}
- type BlockDim = Either Exp KernelConstExp
- data KernelConst
- type KernelConstExp = PrimExp KernelConst
- module Futhark.CodeGen.ImpCode
- module Futhark.IR.GPU.Sizes
Documentation
An program calling OpenCL kernels.
Program | |
|
type KernelName = Name Source #
The name of a kernel.
An argument to be passed to a kernel.
Host-level OpenCL operation.
data KernelSafety Source #
Information about bounds checks and how sensitive it is to errors. Ordered by least demanding to most.
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.OpenCL showsPrec :: Int -> KernelSafety -> ShowS # show :: KernelSafety -> String # showList :: [KernelSafety] -> ShowS # | |
Eq KernelSafety Source # | |
Defined in Futhark.CodeGen.ImpCode.OpenCL (==) :: KernelSafety -> KernelSafety -> Bool # (/=) :: KernelSafety -> KernelSafety -> Bool # | |
Ord KernelSafety Source # | |
Defined in Futhark.CodeGen.ImpCode.OpenCL 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 KernelTarget Source #
The target platform when compiling imperative code to a Program
Instances
Eq KernelTarget Source # | |
Defined in Futhark.CodeGen.ImpCode.OpenCL (==) :: KernelTarget -> KernelTarget -> Bool # (/=) :: KernelTarget -> KernelTarget -> Bool # |
data FailureMsg Source #
Something that can go wrong in a kernel. Part of the machinery for reporting error messages from within kernels.
data KernelConst Source #
A run-time constant related to kernels.
Instances
Show KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU showsPrec :: Int -> KernelConst -> ShowS # show :: KernelConst -> String # showList :: [KernelConst] -> ShowS # | |
FreeIn KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU freeIn' :: KernelConst -> FV Source # | |
Eq KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU (==) :: KernelConst -> KernelConst -> Bool # (/=) :: KernelConst -> KernelConst -> Bool # | |
Ord KernelConst Source # | |
Defined in Futhark.CodeGen.ImpCode.GPU 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 pretty :: KernelConst -> Doc ann # prettyList :: [KernelConst] -> Doc ann # |
type KernelConstExp = PrimExp KernelConst Source #
An expression whose variables are kernel constants.
module Futhark.CodeGen.ImpCode
module Futhark.IR.GPU.Sizes