Max Threads per SM How can I query the max number of threads per SM?

Question:
How do I query the total number of threads or warps for an SM?
I only see calls to query the total number per thread block.

Workaround:
I can query the compute capability and implement my own lookup.
Is there a better way?

Hello,

I’m wondering the same question, there is no solution to get the max num. of threads per SM except the compute capability ?

Thank you,

Best Regards

call cuDeviceGetAttribute with CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK flag

That’s “per block”.

We’re asking “per SM”.

E.g. for the Fermi the first number is 1024, the latter is 1536.

You can use with CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR

In which situation is the max threads per SM relevant? In the program one specifies the number of threads per block. A block is executed on a SM, if there are resources blocks can be assign in the same time to the same SM.