|
| 1 | +<!-- SPDX-License-Identifier: PMPL-1.0-or-later --> |
| 2 | +<!-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> --> |
| 3 | +# TOPOLOGY.md — futharkiser |
| 4 | + |
| 5 | +## Purpose |
| 6 | + |
| 7 | +futharkiser compiles annotated array operation descriptions to GPU kernels via Futhark. Futhark (Troels Henriksen, DIKU Copenhagen) is a purely functional array language that compiles to OpenCL or CUDA with guaranteed data-race freedom. futharkiser reads kernel descriptions from a `futharkiser.toml` manifest and generates idiomatic Futhark programs using SOACs (second-order array combinators), which are then compiled to the selected GPU backend. It targets engineers who want GPU acceleration with formal data-race guarantees without writing Futhark or GPU code directly. |
| 8 | + |
| 9 | +## Module Map |
| 10 | + |
| 11 | +``` |
| 12 | +futharkiser/ |
| 13 | +├── src/ |
| 14 | +│ ├── main.rs # CLI entry point (clap): init, validate, generate, build, run, info |
| 15 | +│ ├── lib.rs # Library API |
| 16 | +│ ├── manifest/mod.rs # futharkiser.toml parser |
| 17 | +│ ├── codegen/mod.rs # Futhark source, C-ABI header, and build script generation |
| 18 | +│ └── abi/ # Idris2 ABI bridge stubs |
| 19 | +├── examples/ # Worked examples |
| 20 | +├── verification/ # Proof harnesses |
| 21 | +├── container/ # Stapeln container ecosystem |
| 22 | +└── .machine_readable/ # A2ML metadata |
| 23 | +``` |
| 24 | + |
| 25 | +## Data Flow |
| 26 | + |
| 27 | +``` |
| 28 | +futharkiser.toml manifest |
| 29 | + │ |
| 30 | + ┌────▼────┐ |
| 31 | + │ Manifest │ parse + validate kernel descriptions and SOAC annotations |
| 32 | + │ Parser │ |
| 33 | + └────┬────┘ |
| 34 | + │ validated kernel config |
| 35 | + ┌────▼────┐ |
| 36 | + │ Analyser │ resolve array shapes, infer parallelism strategy |
| 37 | + └────┬────┘ |
| 38 | + │ intermediate representation |
| 39 | + ┌────▼────┐ |
| 40 | + │ Codegen │ emit generated/futharkiser/ (.fut source, C-ABI header, build script) |
| 41 | + └────┬────┘ |
| 42 | + │ Futhark programs + C-ABI headers |
| 43 | + ┌────▼────┐ |
| 44 | + │ Futhark │ compile to OpenCL/CUDA GPU kernels |
| 45 | + └─────────┘ |
| 46 | +``` |
0 commit comments