OpenACC shared memory usage

Is it to know how much shared memory is being used on NVIDIA GPUs at compile-time? (For exampla : How many registers is use)

Yes, add the option “-ta=tesla:ptxinfo” to your compile flags. This will have ptxas report the amount of shared memory used per kernel as well the registers per thread.

-Mat

Thanks, It’s OK, I got

ptxas info    : 0 bytes gmem
ptxas info    : Compiling entry function 'main_22_gpu' for 'sm_35'
ptxas info    : Function properties for main_22_gpu
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 21 registers, 348 bytes cmem[0]

What does mean 0 bytes gmem & 348 bytes cmem[0]?Rem: gmem is always 0 and cmem bytes values are different depending on sm_xx with xx = [35, 50, 60, 70]

gmem is the amount of static global memory. cmem is the constant memory.

See: https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#printing-code-generation-statistics

Hope this helps,
Mat

It helped me. Thank you.