Skip to content

Commit 64ffce2

Browse files
hyperpolymathclaude
andcommitted
feat: futharkiser Phase 1 — kernel parser, Futhark codegen, GPU backend support
Generate Futhark programs from kernel descriptions. SOACs: map, reduce, scan, scatter, histogram. GPU backends: OpenCL, CUDA, multicore, C. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 67eda0e commit 64ffce2

11 files changed

Lines changed: 3000 additions & 55 deletions

File tree

Cargo.lock

Lines changed: 906 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# futharkiser manifest — image processing pipeline example
3+
#
4+
# Demonstrates all five SOAC patterns (map, reduce, scan, scatter, histogram)
5+
# applied to a typical image-processing workload. Run with:
6+
#
7+
# futharkiser generate -m examples/image-pipeline/futharkiser.toml
8+
# futharkiser build -m examples/image-pipeline/futharkiser.toml
9+
10+
[project]
11+
name = "image-pipeline"
12+
13+
# --- Map: element-wise pixel transformation ---
14+
[[kernels]]
15+
name = "blur"
16+
pattern = "map"
17+
input-type = "[f32]"
18+
output-type = "[f32]"
19+
description = "Apply Gaussian blur to each pixel"
20+
21+
# --- Histogram: bin pixel intensities ---
22+
[[kernels]]
23+
name = "histogram"
24+
pattern = "histogram"
25+
input-type = "[u8]"
26+
output-type = "[i64]"
27+
bins = 256
28+
description = "Compute pixel intensity histogram"
29+
30+
# --- Scan: inclusive prefix sum (e.g. for integral image) ---
31+
[[kernels]]
32+
name = "prefix_sum"
33+
pattern = "scan"
34+
input-type = "[f64]"
35+
output-type = "[f64]"
36+
operator = "+"
37+
description = "Inclusive prefix sum for integral image computation"
38+
39+
# --- Reduce: sum all pixel values ---
40+
[[kernels]]
41+
name = "total_intensity"
42+
pattern = "reduce"
43+
input-type = "[f64]"
44+
output-type = "[f64]"
45+
operator = "+"
46+
description = "Sum all pixel intensities"
47+
48+
# --- Scatter: write computed values to specific pixel locations ---
49+
[[kernels]]
50+
name = "write_pixels"
51+
pattern = "scatter"
52+
input-type = "[f32]"
53+
output-type = "[f32]"
54+
description = "Indirect write to specific pixel locations"
55+
56+
[gpu]
57+
backend = "opencl"
58+
tuning = true

0 commit comments

Comments
 (0)