Installation
These instructions build WAVE from a checkout. Each crate builds independently.
Toolchain
Section titled “Toolchain”Install Git and a stable Rust toolchain through rustup, then build the compiler, assembler, emulator, runtime, and backends:
git clone https://github.com/Oabraham1/wave.gitcd wavefor crate in wave-decode wave-asm wave-dis wave-emu wave-compiler wave-metal wave-ptx wave-hip wave-sycl wave-runtime; do cargo build --release --manifest-path "$crate/Cargo.toml"doneEach crate writes its output to its own target/release/ directory. The runtime build also produces the shared library used by the Python SDK. Keep the checkout available when using the SDKs from source.
To put the command-line tools on your PATH:
cargo install --path wave-compilercargo install --path wave-asmcargo install --path wave-discargo install --path wave-emuPython
Section titled “Python”From the repository root:
python3 -m pip install -e ./sdk/pythonCheck the installed version and device detection:
import wave_gpu
print(wave_gpu.__version__)print(wave_gpu.device())Continue to Quick start for a complete emulator example.
Add the SDK to your application, using the path to your checkout:
cargo add wave-gpu --path /path/to/wave/sdk/rustThe crate is imported as wave_gpu:
use wave_gpu::device;
fn main() -> Result<(), wave_gpu::RuntimeError> { let dev = device::detect()?; println!("{}", dev.name); Ok(())}The C++ SDK requires C++17 and CMake 3.16 or later. Build it from the repository root:
cmake -S sdk/cpp -B sdk/cpp/build -DCMAKE_BUILD_TYPE=Releasecmake --build sdk/cpp/buildctest --test-dir sdk/cpp/build --output-on-failureTo include the SDK in a CMake project:
add_subdirectory(/path/to/wave/sdk/cpp wave-sdk)target_link_libraries(your_target PRIVATE wave)Headers are available through #include <wave/wave.h>. See the C++ guide for buffer ownership and launch arguments.
TypeScript
Section titled “TypeScript”The TypeScript SDK requires Node.js 18 or later. Build it in the checkout:
cd sdk/jsnpm installnpm run buildFrom your application directory, install the local package:
npm install /path/to/wave/sdk/jsDetect the device:
import { device } from "wave-gpu";
async function main() { console.log(await device());}
main();GPU toolchains
Section titled “GPU toolchains”Vendor compilation and dispatch require the corresponding toolchain. Emulator execution does not require a vendor SDK.
| Backend | Toolchain |
|---|---|
wave-metal | Xcode command-line tools and Metal |
wave-ptx | NVIDIA CUDA toolkit |
wave-hip | AMD ROCm and hipcc |
wave-sycl | Intel oneAPI and dpcpp |
Run from the repository root:
for crate in wave-decode wave-asm wave-dis wave-emu wave-compiler wave-metal wave-ptx wave-hip wave-sycl wave-runtime sdk/rust tests/spec-verification; do cargo test --manifest-path "$crate/Cargo.toml"donebash tests/ci/run_emulator_tests.shbash tests/ci/run_backend_tests.sh