tester
tester

Reputation: 77

how to compute GPU's max. num. of threads programmatically

Can you show how to compute maximum number of threads that can reside in specific GPU using CUDA? I.e. maximum number of threads that I can assign to kernel. Thanks!

Upvotes: 1

Views: 2420

Answers (1)

tskuzzy
tskuzzy

Reputation: 36446

You can get the maximum number of threads per multiprocessor (SM) using cudaGetDeviceProperties(). Then multiply this by the number of SMs in your card.

Though this does not necessarily mean you should execute this number of threads. Consult this SO answer for a good explanation.

Upvotes: 1

Related Questions