futhark-0.25.15: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
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

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

Pretty OpenCL Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.OpenCL

Methods

pretty :: OpenCL -> Doc ann #

prettyList :: [OpenCL] -> 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 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

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.