GPU Shared Memory Swizzle Visualizer

Visualize how Swizzle<BBits, MBase, SShift> remaps addresses to avoid bank conflicts

SMEM Banks
Bytes per bank (1-32)
Number of banks
Presets
Swizzle Unit
Unit size = 2^MBase bytes
Swizzle Tile
Tile = 2^BBits × 2^BBits units
Grid Configuration
Swz units/grid row = 2^SShift
Default = tile height
Inspect
Trace logical column

Single Swizzle Tile

This is one swizzle tile. The grid below is composed of these tiles.

Tile WITHOUT Swizzle
Tile WITH Swizzle

Full Grid Layout

The grid is composed of swizzle tiles. Tile boundaries are marked with thick black lines.

Grid WITHOUT Swizzle
Color & number = logical column
Grid WITH Swizzle
Color & number = logical column stored at each physical slot

Address Inspector

Click any cell in the grids above or SMEM bank organization below to see its address details.

SMEM Bank Organization

Bank-level view of SMEM with standard row-major layout and swizzle applied. Each grid row is stored consecutively in memory. Numbers show logical column stored at each bank position.

Swizzle Formula

// For swz unit at logical position (row, col):

mask = (1 << BBits) - 1
col_in_tile = col & mask // col mod 2^BBits
row_mod = row & mask // row mod 2^BBits
swizzled_slot = col_in_tile ^ row_mod

// The swizzled slot determines which bank group is accessed.
// Looking down any column: all row_mod values are different,
// so all swizzled_slot values are different → no bank conflicts!

How to Read This Visualization

Swizzle Tile: The fundamental swizzle unit (2^BBits × 2^BBits swz units). The swizzle pattern is defined within a tile.

Grid: The full shared memory layout, composed of one or more swizzle tiles. Tile boundaries are marked with thick black lines.

Colors: Each color represents a logical column. In the swizzled view, colors show which logical column's data is stored at each physical slot.

WITHOUT Swizzle: Looking down any column, all cells have the same color → bank conflict when reading column-major.

WITH Swizzle: Looking down any column, colors are shuffled → no bank conflicts, data spread across different logical columns.

To verify: Use "Highlight Slot" to see which logical columns are accessed when reading a physical slot across rows.