How to find out how much local memory size a function uses? in a compiled cubin file

I have a compiled cubin file, how to figure out how much local and shared memory size and number of registers a function uses?

Thanks

Try adding the following to your nvcc commandline: -Xptxas -v

I am reasonably sure this will show register usage and shared memory usage, not sure about local memory.

Yes, it shows local and constant memory usage as well as register and static shared memory allocation.

Yes, that works. Do you think it would be a nice addition if there would be a header file generated with macros defining these values so that you could reference in the code such things as the smem and register usage and do the math to compute the kernel launch dimensions without getting CU_ERROR_OUT_OF_RESOURCES ?