High-performance, portable GPU primitives for Julia — a pure Julia implementation delivering performance competitive with optimized CUDA C++ libraries.
![]() |
![]() |
![]() |
![]() |
![]() |
|
Benchmarked on an NVIDIA A40 (Ampere) against optimized CUDA C++ baselines (CUB / cuBLAS). More GPUs (RTX 1000, MI300X) and raw CSV data 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
- 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 A40, RTX 1000, and AMD 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




