Compiler Explorer
The Compiler Explorer compiles your CUDA source files locally and displays the generated assembly output—PTX (Parallel Thread Execution) and SASS (Shader Assembly)—directly in VS Code.What is it?
When you write CUDA code, it goes through multiple compilation stages:- CUDA C++ → PTX: The
nvcccompiler generates PTX, a virtual assembly language - PTX → SASS: The GPU driver compiles PTX to SASS, the actual machine code for your specific GPU
- See how your code translates to GPU instructions
- Identify inefficient patterns (excessive memory operations, poor instruction mix)
- Optimize register usage and memory access patterns
- Debug performance issues at the lowest level
Features
Local Compilation
Compiles using your local CUDA toolkit—no cloud services needed.
Auto-Detection
Automatically detects your nvcc version and GPU architecture.
Live Compilation
Recompiles automatically when you save your file.
Side-by-Side View
View source and assembly side by side for easy comparison.
Requirements
| Requirement | Details |
|---|---|
| CUDA Toolkit | nvcc must be installed and on your PATH |
| For SASS | nvdisasm must be available (included with CUDA Toolkit) |
Verifying Installation
Supported Files
| File Type | Support |
|---|---|
.cu | ✅ CUDA source files — generates PTX and SASS |
.cuh | ❌ Header files — not compilable on their own |
.cpp | ❌ C++ files — use .cu for CUDA code |
.py | ❌ Python files — not supported |
Only
.cu files can be compiled. Header files (.cuh) cannot be compiled standalone—select the .cu file that includes them.Quick Start
- Select Compiler Explorer from the Wafer tool dropdown
- Click the file selector to choose a
.cufile - Click Compile to generate PTX and SASS
- Use the tabs to switch between Source, PTX, and SASS views
Compiling CUDA Files
Learn how to compile and configure the compiler →