NCU dynamic shared memory display question

In my code, I uses:

cudaFuncSetAttribute(my_kernel,cudaFuncAttributeMaxDynamicSharedMemorySize, 100*1024);

Previously I believe block itself will uses 1KB shared memory, but here, why dynamic is 102?? And what is 135??!!


Nsight Compute uses SI units for sizes, i.e. multiples of 1000. This means that 100*1024 / 1000 = 102.4.

The number set using cudaFuncAttributeMaxDynamicSharedMemorySize is not a fixed value that is guaranteed by the driver, it is rather requested by the client and the driver will select an appropriate actual value as close as possible that satisfies this request.

1 Like