thrust reduction result on device memory

后端 未结 2 2097
春和景丽
春和景丽 2020-12-19 13:59

Is it possible to leave the return value of a thrust::reduce operation in device-allocated memory? In case it is, is it just as easy as assigning the value to a cudaMalloc\'

2条回答
  •  梦毁少年i
    2020-12-19 14:21

    Yes, it should be possible by using thrust::reduce_by_key instead with a thrust::constant_iterator supplied for the keys.

提交回复
热议问题