Getting Started
Getting Started with Oa
Install, build, and run your first GPU compute program.
Requirements
- GPU SDK — includes
slangcshader compiler - CMake 3.25+ and Ninja
- Clang (C++20)
- vcpkg (for dependency management)
Install
Terminal
# Build from sourcecmake --preset release && ninja -C build/release# Installcmake --install build/release --prefix ~/.local# Or via vcpkg (private registry)# Add to vcpkg-configuration.json, then cmake handles it
Hello GPU
Main.cpp
#include <oa/runtime/engine.h>#include <oa/core/log.h>int main() {auto rt = OaEngine::Create({.AppName = "HelloGpu"}).Unwrap();OaLog::Info("Device: {}", rt.Device.Name);OaLog::Info("VRAM: {} MB", rt.Device.VramMb);rt.Destroy();}
Include Pattern
| Include | What |
|---|---|
oa/oa.h | Everything |
oa/runtime.h | OaEngine + all runtime |
oa/core.h | All core types (CPU only) |
oa/ml/tensor.h | Tensors only |
oa/crypto/hash.h | SHAKE-256, Merkle tree |
oa/network.h | TCP + HTTP server |