futhark-0.23.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.CodeGen.ImpCode.Multicore

Description

Multicore imperative code.

Synopsis

Documentation

type Program = Functions Multicore Source #

An imperative multicore program.

data Multicore Source #

A multicore operation.

Constructors

SegOp String [Param] ParallelTask (Maybe ParallelTask) [Param] SchedulerInfo 
ParLoop String MCCode [Param] 
ISPCKernel MCCode [Param]

A kernel of ISPC code, or a scoped block in regular C.

ForEach VName Exp Exp MCCode

A foreach loop in ISPC, or a regular for loop in C.

ForEachActive VName MCCode

A foreach_active loop in ISPC, or a single execution in C.

ExtractLane VName Exp Exp

Extract a value from a given lane and assign it to a variable. This is just a regular assignment in C.

GetLoopBounds VName VName

Retrieve inclusive start and exclusive end indexes of the chunk we are supposed to be executing. Only valid immediately inside a ParLoop construct!

GetTaskId VName

Retrieve the task ID that is currently executing. Only valid immediately inside a ParLoop construct!

GetNumTasks VName

Retrieve the number of subtasks to execute. Only valid immediately inside a SegOp or ParLoop construct!

Atomic AtomicOp 

Instances

Instances details
FreeIn Multicore Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Methods

freeIn' :: Multicore -> FV Source #

Pretty Multicore Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Methods

pretty :: Multicore -> Doc ann #

prettyList :: [Multicore] -> Doc ann #

type MCCode = Code Multicore Source #

Multicore code.

data Scheduling Source #

Whether the Scheduler should schedule the tasks as Dynamic or it is restainted to Static

Constructors

Dynamic 
Static 

Instances

Instances details
Pretty Scheduling Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Methods

pretty :: Scheduling -> Doc ann #

prettyList :: [Scheduling] -> Doc ann #

data SchedulerInfo Source #

Information about parallel work that is do be done. This is passed to the scheduler to help it make scheduling decisions.

Constructors

SchedulerInfo 

Fields

Instances

Instances details
FreeIn SchedulerInfo Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Pretty SchedulerInfo Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Methods

pretty :: SchedulerInfo -> Doc ann #

prettyList :: [SchedulerInfo] -> Doc ann #

data AtomicOp Source #

Atomic operations return the value stored before the update. This old value is stored in the first VName. The second VName is the memory block to update. The Exp is the new value.

Instances

Instances details
Show AtomicOp Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

FreeIn AtomicOp Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Methods

freeIn' :: AtomicOp -> FV Source #

newtype ParallelTask Source #

A task for a SegOp.

Constructors

ParallelTask MCCode 

Instances

Instances details
FreeIn ParallelTask Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Pretty ParallelTask Source # 
Instance details

Defined in Futhark.CodeGen.ImpCode.Multicore

Methods

pretty :: ParallelTask -> Doc ann #

prettyList :: [ParallelTask] -> Doc ann #

data KernelHandling Source #

Whether lexicalMemoryUsageMC should look inside nested kernels or not.

lexicalMemoryUsageMC :: KernelHandling -> Function Multicore -> Map VName Space Source #

Like lexicalMemoryUsage, but traverses some inner multicore ops.