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

Futhark.CodeGen.ImpCode.OpenCL

Description

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

Documentation

data Program Source #

An program calling OpenCL kernels.

Constructors

Program 

Fields

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

Methods

showsPrec :: Int -> KernelArg -> ShowS

show :: KernelArg -> String

showList :: [KernelArg] -> ShowS

type CLCode = Code OpenCL Source #

A piece of code calling OpenCL.

data OpenCL Source #

Host-level OpenCL operation.

Instances

Instances details
Show OpenCL Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

Methods

showsPrec :: Int -> OpenCL -> ShowS

show :: OpenCL -> String

showList :: [OpenCL] -> ShowS

Pretty OpenCL Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

Methods

pretty :: OpenCL -> Doc ann Source #

prettyList :: [OpenCL] -> Doc ann Source #

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

Instances details
Show KernelSafety Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

Methods

showsPrec :: Int -> KernelSafety -> ShowS

show :: KernelSafety -> String

showList :: [KernelSafety] -> ShowS

Eq KernelSafety Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

Methods

(==) :: KernelSafety -> KernelSafety -> Bool

(/=) :: KernelSafety -> KernelSafety -> Bool

Ord KernelSafety Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

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

Instances details
Eq KernelTarget Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

Methods

(==) :: 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.

Constructors

FailureMsg 

type BlockDim = Either Exp KernelConstExp Source #

The size of one dimension of a block.

data KernelConst Source #

A run-time constant related to kernels.

Instances

Instances details
FreeIn KernelConst Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.GPU

Show KernelConst Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.GPU

Methods

showsPrec :: Int -> KernelConst -> ShowS

show :: KernelConst -> String

showList :: [KernelConst] -> ShowS

Eq KernelConst Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.GPU

Methods

(==) :: KernelConst -> KernelConst -> Bool

(/=) :: KernelConst -> KernelConst -> Bool

Ord KernelConst Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.GPU

Pretty KernelConst Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.GPU

type KernelConstExp = PrimExp KernelConst Source #

An expression whose variables are kernel constants.