| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Futhark.CodeGen.ImpCode.Multicore
Description
Multicore imperative code.
Synopsis
- type Program = Functions Multicore
- data Multicore
- = SegOp String [Param] ParallelTask (Maybe ParallelTask) [Param] SchedulerInfo
- | ParLoop String MCCode [Param]
- | ISPCKernel MCCode [Param]
- | ForEach VName Exp Exp MCCode
- | ForEachActive VName MCCode
- | ExtractLane VName Exp Exp
- | GetLoopBounds VName VName
- | GetTaskId VName
- | GetNumTasks VName
- | Atomic AtomicOp
- type MCCode = Code Multicore
- data Scheduling
- data SchedulerInfo = SchedulerInfo {}
- data AtomicOp
- = AtomicAdd IntType VName VName (Count Elements (TExp Int32)) Exp
- | AtomicSub IntType VName VName (Count Elements (TExp Int32)) Exp
- | AtomicAnd IntType VName VName (Count Elements (TExp Int32)) Exp
- | AtomicOr IntType VName VName (Count Elements (TExp Int32)) Exp
- | AtomicXor IntType VName VName (Count Elements (TExp Int32)) Exp
- | AtomicXchg PrimType VName VName (Count Elements (TExp Int32)) Exp
- | AtomicCmpXchg PrimType VName VName (Count Elements (TExp Int32)) VName Exp
- newtype ParallelTask = ParallelTask MCCode
- data KernelHandling
- lexicalMemoryUsageMC :: KernelHandling -> Function Multicore -> Map VName Space
- module Futhark.CodeGen.ImpCode
Documentation
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 |
| GetTaskId VName | Retrieve the task ID that is currently executing. Only valid
immediately inside a |
| GetNumTasks VName | Retrieve the number of subtasks to execute. Only valid
immediately inside a |
| Atomic AtomicOp |
data Scheduling Source #
Whether the Scheduler should schedule the tasks as Dynamic or it is restainted to Static
Instances
| Pretty Scheduling Source # | |
Defined in Futhark.CodeGen.ImpCode.Multicore | |
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
| FreeIn SchedulerInfo Source # | |
Defined in Futhark.CodeGen.ImpCode.Multicore Methods freeIn' :: SchedulerInfo -> FV Source # | |
| Pretty SchedulerInfo Source # | |
Defined in Futhark.CodeGen.ImpCode.Multicore | |
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.
Constructors
newtype ParallelTask Source #
A task for a SegOp.
Constructors
| ParallelTask MCCode |
Instances
| FreeIn ParallelTask Source # | |
Defined in Futhark.CodeGen.ImpCode.Multicore Methods freeIn' :: ParallelTask -> FV Source # | |
| Pretty ParallelTask Source # | |
Defined in Futhark.CodeGen.ImpCode.Multicore | |
data KernelHandling Source #
Whether lexicalMemoryUsageMC should look inside nested kernels
or not.
Constructors
| TraverseKernels | |
| OpaqueKernels |
lexicalMemoryUsageMC :: KernelHandling -> Function Multicore -> Map VName Space Source #
Like lexicalMemoryUsage, but traverses some inner multicore ops.
module Futhark.CodeGen.ImpCode