在推力中启动配置 [英] Launch Configuration in Thrust
问题描述
我正在尝试对使用Thrust编码的算法进行一些实验.我想知道每个块的线程数对算法性能的影响.是否可以限制推力,以使每个块使用的螺纹数量不超过X个?
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?
推荐答案
Thrust无法提供直接设置每个块的线程数或特定内核调用中使用的块数的任何功能.
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.
这篇关于在推力中启动配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!