问题
I am trying to run some experiments on an algorithm coded in Thrust. I'd like to know the impact of the number of threads per block in the performance of my algorithm. Is it possible to restrict thrust so that it does not use more than X number of threads per block?
回答1:
Thrust doesn't expose any ability to either directly set the number of threads per block or the number of blocks used in a particular kernel call.
These things are indirectly determined by algorithm and problem size, but you have no direct control of them.
Of course, thrust is an open source header/template library, so in theory you could make any code changes you want. I assume that's not what you're asking and is outside the scope of my answer.
来源:https://stackoverflow.com/questions/39679439/launch-configuration-in-thrust