CUDA - determine number of banks in shared memory
Asked Answered
U

1

7

Shared memory is "striped" into banks. This leads to the whole issue of bank conflicts, as we all know.

Question: But how can you determine how many banks ("stripes") exist in shared memory?

(Poking around NVIDIA "devtalk" forums, it seems that per-block shared memory is "striped" into 16 banks. But how do we know this? The threads suggesting this are a few years old. Have things changed? Is it fixed on all NVIDIA CUDA-capable cards? Is there a way to determine this from the runtime API (I don't see it there, e.g. under cudaDeviceProp)? Is there a manual way to determine it at runtime?)

Univocal answered 10/6, 2013 at 15:14 Comment(1)
This post says Fermi is 32 banks. Have you tried looking in the CUDA programming Guide? That's where the poster says he got this information.Bonded
D
11

As @RobertHarvey says, it's documented. The programming guide indicates 16 banks for compute capability 1.x, and 32 banks for compute capability 2.x and 3.x. You can thus make any decisions based on the compute capability (major version) returned in device properties.

The general link to the cuda on-line documentation is contained in the info link for the cuda tag.

Dapsang answered 10/6, 2013 at 15:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.