Getting CUDA Thrust to use a CUDA stream of your choice

前端 未结 2 1149
面向向阳花
面向向阳花 2021-01-01 03:50

Looking at kernel launches within the code of CUDA Thrust, it seems they always use the default stream. Can I make Thrust use a stream of my choice? Am I missing something i

2条回答
  •  伪装坚强ぢ
    2021-01-01 04:24

    No you are not missing anything (at least up to the release snapshot which ships with CUDA 6.0).

    The original Thrust tag based dispatch system deliberately abstracts all of the underlying CUDA API calls away, sacrificing some performance for ease of use and consistency (keep in mind that thrust has backends other than CUDA). If you want that level of flexibility, you will need to try another library (CUB, for example).

    In versions since the CUDA 7.0 snapshot it has become possible to set a stream of choice for thrust operations via the execution policy and dispatch feature.

提交回复
热议问题