Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data KernelConstants = KernelConstants {}
- keyWithEntryPoint :: Name -> Name -> Name
- type CallKernelGen = ImpM ExplicitMemory HostOp
- type InKernelGen = ImpM ExplicitMemory KernelOp
- computeThreadChunkSize :: SplitOrdering -> Exp -> Count Elements Exp -> Count Elements Exp -> VName -> ImpM lore op ()
- groupReduce :: ExplicitMemorish lore => KernelConstants -> Exp -> Lambda lore -> [VName] -> ImpM lore KernelOp ()
- groupScan :: KernelConstants -> Maybe (Exp -> Exp -> Exp) -> Exp -> Lambda ExplicitMemory -> [VName] -> ImpM ExplicitMemory KernelOp ()
- isActive :: [(VName, SubExp)] -> Exp
- sKernelThread :: String -> Count NumGroups Exp -> Count GroupSize Exp -> VName -> (KernelConstants -> InKernelGen ()) -> CallKernelGen ()
- sKernelGroup :: String -> Count NumGroups Exp -> Count GroupSize Exp -> VName -> (KernelConstants -> InKernelGen ()) -> CallKernelGen ()
- sKernelSimple :: String -> Exp -> (KernelConstants -> InKernelGen ()) -> CallKernelGen ()
- sReplicate :: VName -> Shape -> SubExp -> CallKernelGen ()
- sIota :: VName -> Exp -> Exp -> Exp -> IntType -> CallKernelGen ()
- sCopy :: PrimType -> MemLocation -> MemLocation -> Count Elements Exp -> CallKernelGen ()
- compileThreadResult :: SegSpace -> KernelConstants -> PatElem ExplicitMemory -> KernelResult -> InKernelGen ()
- compileGroupResult :: SegSpace -> KernelConstants -> PatElem ExplicitMemory -> KernelResult -> InKernelGen ()
- virtualiseGroups :: KernelConstants -> SegVirt -> Exp -> (VName -> InKernelGen ()) -> InKernelGen ()
- getSize :: String -> SizeClass -> CallKernelGen VName
- atomicUpdate :: ExplicitMemorish lore => Space -> [VName] -> [Exp] -> Lambda lore -> Locking -> ImpM lore KernelOp ()
- atomicUpdateLocking :: ExplicitMemorish lore => Lambda lore -> Either (AtomicUpdate lore) (Locking -> AtomicUpdate lore)
- data Locking = Locking {
- lockingArray :: VName
- lockingIsUnlocked :: Exp
- lockingToLock :: Exp
- lockingToUnlock :: Exp
- lockingMapping :: [Exp] -> Exp
- type AtomicUpdate lore = Space -> [VName] -> [Exp] -> ImpM lore KernelOp ()
Documentation
type CallKernelGen = ImpM ExplicitMemory HostOp Source #
type InKernelGen = ImpM ExplicitMemory KernelOp Source #
computeThreadChunkSize :: SplitOrdering -> Exp -> Count Elements Exp -> Count Elements Exp -> VName -> ImpM lore op () Source #
groupReduce :: ExplicitMemorish lore => KernelConstants -> Exp -> Lambda lore -> [VName] -> ImpM lore KernelOp () Source #
groupScan :: KernelConstants -> Maybe (Exp -> Exp -> Exp) -> Exp -> Lambda ExplicitMemory -> [VName] -> ImpM ExplicitMemory KernelOp () Source #
sKernelThread :: String -> Count NumGroups Exp -> Count GroupSize Exp -> VName -> (KernelConstants -> InKernelGen ()) -> CallKernelGen () Source #
sKernelGroup :: String -> Count NumGroups Exp -> Count GroupSize Exp -> VName -> (KernelConstants -> InKernelGen ()) -> CallKernelGen () Source #
sKernelSimple :: String -> Exp -> (KernelConstants -> InKernelGen ()) -> CallKernelGen () Source #
A kernel with the given number of threads, running per-thread code.
sReplicate :: VName -> Shape -> SubExp -> CallKernelGen () Source #
Perform a Replicate with a kernel.
sIota :: VName -> Exp -> Exp -> Exp -> IntType -> CallKernelGen () Source #
Perform an Iota with a kernel.
sCopy :: PrimType -> MemLocation -> MemLocation -> Count Elements Exp -> CallKernelGen () Source #
compileThreadResult :: SegSpace -> KernelConstants -> PatElem ExplicitMemory -> KernelResult -> InKernelGen () Source #
compileGroupResult :: SegSpace -> KernelConstants -> PatElem ExplicitMemory -> KernelResult -> InKernelGen () Source #
virtualiseGroups :: KernelConstants -> SegVirt -> Exp -> (VName -> InKernelGen ()) -> InKernelGen () Source #
For many kernels, we may not have enough physical groups to cover the logical iteration space. Some groups thus have to perform double duty; we put an outer loop to accomplish this. The advantage over just launching a bazillion threads is that the cost of memory expansion should be proportional to the number of *physical* threads (hardware parallelism), not the amount of application parallelism.
atomicUpdate :: ExplicitMemorish lore => Space -> [VName] -> [Exp] -> Lambda lore -> Locking -> ImpM lore KernelOp () Source #
atomicUpdateLocking :: ExplicitMemorish lore => Lambda lore -> Either (AtomicUpdate lore) (Locking -> AtomicUpdate lore) Source #
atomicUpdate
, but where it is explicitly visible whether a
locking strategy is necessary.
Locking strategy used for an atomic update.
Locking | |
|