The Factory Method: Spawning GPU Kernels
Delegate the creation of GPU tasks via sum types and dynamic mappings.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Transmutation // Synthesis
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
type element = #fire | #ice | #void
let weave (e: element) (intensity: i32) : i32 =
match e
case #fire -> intensity * 2
case #ice -> intensity / 2
case #void -> 0
Runic Tags:
#futhark
#factory
#sum-types