Loading...
See CUDA optimization tips without running code
CodeLens automatically analyzes your CUDA code and shows:
Two lines appear above each kernel:
Line 1 - Runtime Performance:
✅ addVectors: 18.5ms • SM:95.3% • Occ:87.5% • Mem:245.8GB/sLine 2 - Static Analysis:
⚠️ Static: Registers: 64 • Shared: 8KB • Max occupancy: 50% (reg-limited)Too many registers per thread:
Too much shared memory:
CodeLens shows spill warnings:
Best Practices: Keep occupancy above 50%, fix red warnings first, save file to update metrics, and use build settings for PTX analysis.
Remember: CodeLens shows estimates. Always benchmark to verify actual performance.