TinyGPUlang
Tutorial on building a gpu compiler backend in LLVM
Install / Use
/learn @adamtiger/TinyGPUlangREADME
tinyGPUlang
Tutorial on building a gpu compiler backend in LLVM
Goals
The goal of this tutorial is to show a simple example on how to generate ptx from the llvm ir and how to write the IR itself to access cuda features.
For the sake of demonstration a language frontend is also provided. The main idea of the language is to support pointwise (aka elementwise) operations with gpu acceleration.
If you are just curios about the code generation backend, you can jump directly to The code generator for NVPTX backend part.
What is inside the repo?
- tinyGPUlang: the compiler, creates ptx from tgl (the example language file)
- test: a cuda driver api based test for the generated ptx
- examples: example tgl files
- docs: documentation for the tutorial
Tutorial content
- Overview
- The TGL language
- Abstract Syntax Tree
- The code generator for NVPTX backend
- Short overview of the parser
Build
See the How to build the project? documentation for further details.
References
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
