Skip to main content

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:
  1. CUDA C++ → PTX: The nvcc compiler generates PTX, a virtual assembly language
  2. PTX → SASS: The GPU driver compiles PTX to SASS, the actual machine code for your specific GPU
Understanding these outputs helps you:
  • 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

RequirementDetails
CUDA Toolkitnvcc must be installed and on your PATH
For SASSnvdisasm must be available (included with CUDA Toolkit)

Verifying Installation

# Check nvcc
nvcc --version

# Check nvdisasm (for SASS output)
nvdisasm --version

Supported Files

File TypeSupport
.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

  1. Select Compiler Explorer from the Wafer tool dropdown
  2. Click the file selector to choose a .cu file
  3. Click Compile to generate PTX and SASS
  4. Use the tabs to switch between Source, PTX, and SASS views

Compiling CUDA Files

Learn how to compile and configure the compiler →