Hercules
Hercules is a compiler for productively programming heterogeneous systems. The project is structured as follows:
-
hercules_ir
: Core Hercules IR definition and analyses. -
hercules_opt
: Transformations on Hercules IR. -
hercules_cg
: Code generators that compile Hercules IR functions into device-specific code (currently LLVM, CUDA, or Async Rust). -
hercules_rt
: Assorted runtime utilities. -
juno_frontend
: Frontend for the Juno application language, compiles into Hercules IR. -
juno_scheduler
: Frontend for the Juno scheduling language, controls transformations on Hercules IR. -
juno_build
: Build utilities for incorporating Hercules code in Rust programs. -
juno_utils
: Assorted utilities for the Juno frontends. -
hercules_samples
: Samples / tests manually defining Hercules IR textually. -
juno_samples
: Samples / tests of Juno programs. -
hercules_test
: Assorted tests for the Hercules compiler. -
paper_resources
: Assorted figures for publications.
Setup
Hercules is simple to setup. Just clone the repository:
https://gitlab.engr.illinois.edu/llvm/hercules.git
And run all the tests:
cargo test
Or a single sample (see Cargo.toml
for a full list):
cargo test -p juno_matmul
If you want to see the output LLVM / CUDA / Rust code from the Hercules compiler, run with the -vv
flag.
cargo test -p juno_matmul -vv
The written samples are setup with a cuda
feature - if this feature is provided, the Juno program will be targeted onto the GPU, rather than the CPU. This only works if you have the CUDA toolkit installed:
cargo test -p juno_matmul --features=cuda
Some samples also include benchmarks. These use criterion
for measurement. For example (edge_detection
requires the opencv
feature to be enabled to build OpenCV before running):
cargo bench -p juno_edge_detection --features=opencv