cudaOccupancyAvailableDynamicSMemPerBlock returning incorrect value

Honestly, after playing around with the code and reading the docs again, I’m not quite sure what I got hung up on earlier. This is clearly a functional bug. The docs and even the API name contain “dynamic shared memory” and there is no reason to believe reserved shared memory is part of that. Have you filed it as a bug already?