A pure-Julia GPU primitives library that is flexible — every primitive takes an arbitrary operator and an arbitrary element type, your own structs and comparators included; cross-architecture — one implementation runs on both NVIDIA and AMD through KernelAbstractions; and performant — matching, or coming close to, the hand-tuned vendor libraries (CUB / cuBLAS on NVIDIA, rocPRIM / rocBLAS on AMD).
![]() |
![]() |
![]() |
![]() |
![]() |
|
![]() |
![]() |
![]() |
![]() |
![]() |
|
Each figure states its own op, GPU and metric. Forge = KernelForge, AK = AcceleratedKernels; a hatched bar runs off the top of its panel and is labelled with its real value. More GPUs (A40, RTX 1000, MI300X) and the raw CSV data live in the KernelForge-benchmarks repo.
- 📄 Paper — arXiv:2603.18695
- 📖 Documentation — epilliat.github.io/KernelForge.jl — API reference & examples
- 🌐 Homepage — epilliat.github.io/software
- 📊 Benchmarks — KernelForge-benchmarks — raw results across GPUs
using Pkg
Pkg.add("KernelForge")using KernelForge, CUDA # or AMDGPU
x = CUDA.rand(Float32, 10^6)
# Reduction with a custom map + operator
total = KernelForge.mapreduce(abs2, +, x) # sum of squares
# Prefix scan (supports non-commutative ops)
dst = similar(x)
KernelForge.scan!(+, dst, x) # cumulative sum
# Matrix–vector product
A = CUDA.rand(Float32, 1000, 500)
v = CUDA.rand(Float32, 500)
y = KernelForge.matvec(A, v) # y ≈ A * v
# Radix sort, in place
KernelForge.sort!(x)- Map-reduce with custom functions and operators, supporting arbitrary dimensions and multidimensional arrays
- Prefix scan supporting non-commutative operations
- Matrix-vector operations with customizable element-wise and reduction operations
- Matrix-matrix product (
gemm) with customizable element-wise, reduction and epilogue operations, all four transpose states, and an opt-in tensor-core path - Search —
findfirst,findlast,argmax,argminon GPU arrays - Vectorized copy with configurable load/store widths
- Views and strided arrays supported throughout
CUDA (NVIDIA) and AMDGPU (AMD) via weak dependencies; the backend is selected through KernelAbstractions extensions. Tested on NVIDIA A100, A40, RTX 1000 and AMD MI300A, MI300X.
KernelForge.jl is an open-source project maintained in my personal time. If this package is useful to you — especially in a production or HPC setting — you can support its development and maintenance via GitHub Sponsors.
Corporate sponsors receive priority support on issues and an acknowledgment in the documentation.
Thanks to the people who support KernelForge.jl!
MIT














