Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Register File & Occupancy Budget Tables

Addresses apply to ptxas v13.0.88 (CUDA 13.0). VA base 0x400000 (non-PIE).

Browsable data dump for the register allocator's register-file model and occupancy budget. The consuming logic is on the allocator architecture and fat-point algorithm pages.

Register File Limits

The architectural register-file header (consumed by the per-class init callback vtable[896]):

FieldValueMeaning
hdr[0]120GPR banks / count
hdr[1]120GPR count max
hdr[2]64predicate registers
hdr[3]256uniform registers
hdr[4]32barriers
hdr[5]8barrier alloc unit
hdr[6]32convergence barriers
hdr[7]4barrier alloc (b_alloc)
hdr[8]64datapath width

The architectural per-thread GPR ceiling reported to the user remains 255; the 120 figure above is the per-bank count used in the warp-budget table below.

Register Classes

Seven classes (0 skipped in the main loop). Class 6 is the Tensor/Accumulator file; classes 3 and 6 are the only ones eligible for coalescing.

IDNameWidthArch capDescription
0unified / cross-class (skipped)
1R32-bit255general-purpose (R0–R254)
2R (alt)32-bit255GPR variant (RZ sentinel / stat-collector)
3UR32-bit63uniform GPR (UR0–UR62) — coalescing-eligible
4UR (ext)32-bit63uniform GPR variant
5P / UP1-bit7predicate (P0–P6, UP0–UP6)
6Tensor/Acc32-bitper-archMMA/WGMMA accumulator — coalescing-eligible; sub-register selectors 5/6/7 are accumulator lane indices

Class records per SM generation: sm_10x has 97 records across 14 distinct classes (0–13); sm_8x has 24 records / 11 classes (0–10); sm_7x has 150 records / 17 classes (0–16). The class-record stride is 64 bytes; the extended-flag-2 count (the sub-variant pairs used during merge eligibility) is 9 for sm_10x, 0 for sm_8x, 20 for sm_7x.

Warp Budget Table (0x21CE6A0 & 0x21CEE60)

The two budget tables map a per-thread register count to an allocatable-GPR count and a warps-per-scheduler figure. Both use warp granule 64, datapath 64, 32 warps/scheduler, alloc granularity 4. Table 0x21CE6A0 (mode_flag 8) is the GPR path; 0x21CEE60 (mode_flag 1, datapath 256) is the uniform path.

reg/threadGPR allocatable (0x21CE6A0)UR allocatable (0x21CEE60)
842
1684
24126
32168
482412
643216
804020
964824
1125628
1286432
1447236
1608040
1768844
1929648
20810452
22411256
24012060
25612864

The GPR path allocatable count is reg_per_thread / 2 (the 120-bank file is shared two-ways per the datapath); the UR path is reg_per_thread / 4.

Occupancy Constants (0x229C400)

Eight 16-byte rodata records driving max_warps(regs):

LabelVAdwordsInterpretation
sm90 regfile params0x229C4006,128,32768,255alloc_granularity_log2=6; warps/subpartition=128; half_reg_file=32768; max_reg=255
sm90 granularity0x229C41063,7,7,16granularity_mask=63; round_shift=7; max_warps=16
barrier / CTA0x229C4204,2048,8,2barrier_alloc=4; regfile/part=2048; barriers/warp=8; cta_dim=2
sm60/sm70 max warps0x229C43032,32,64,32warp_alloc=32; gran=32; max_warps/sm=64; blocks=32
sm53–sm62 regfile0x229C4406,128,65536,255alloc_granularity_log2=6; warps=128; half_reg_file=65536; max_reg=255
sm35/sm37 max warps0x229C45032,32,48,16warp_alloc=32; gran=32; max_warps=48; blocks=16
sm3x/sm5x max warps0x229C46032,32,48,24warp_alloc=32; gran=32; max_warps=48; blocks=24
sm70+ granularity0x229C47080,7,7,16granularity=80; round=7; max_warps=16

Occupancy formula (sub_A99FE0): max_warps(regs) = (-granularity_mask & (2 * half_reg_file_size / regs)) - warp_offset. The negation rounds the warp count down to the hardware allocation-granularity boundary.

Operand Register-Count Matrices

The per-operand register-count cost matrices (consumed during budget evaluation): reg_base_sizes = [48, 50, 38, 41, 46, 46, 0, 0] (per-class base register footprint). matrix_a and matrix_b are stepped cost tables; matrix_b floors at the ABI minimum of 13 (entries 22–27 = 13) before ramping by 4 per step. The ABI floor of 13 GPRs is the same value enforced by sub_4394D0's > 13 threshold.

Register-ID Arrays

The bank-indexed register-ID arrays (bank << 16 | reg) used to enumerate the physical register namespace per class:

VAcountbankrangestepkind
0x21EE4602401640–8791GP
0x21EE820341576–6091GP
0x21EEBE02401400–6391GP
0x21EEFA0321160–1911GP
0x21EF0201362192–4622paired/wide (64-bit)
0x21EF260161464–4791GP
0x21EF2A0482480–5742paired/wide (64-bit)
0x21EF3602401160–3991GP
0x21EF7201681640–8071GP
0x21EF9E0641808–8711GP

Step-2 arrays are the 64-bit pair namespace (bank 2); step-1 arrays are single 32-bit registers (bank 1).

Cross-References