【发布时间】:2015-03-23 00:43:59
【问题描述】:
while loop {
if condition then compute;
else exit();
...
__syncthreads( );
}
Cuda C 中是否有办法关闭线程,以便 __syncthreads(或其他适当的函数)不会等待它?谢谢。
【问题讨论】:
while loop {
if condition then compute;
else exit();
...
__syncthreads( );
}
Cuda C 中是否有办法关闭线程,以便 __syncthreads(或其他适当的函数)不会等待它?谢谢。
【问题讨论】:
据我所知,没有办法从 Cuda 中的线程“退出”。
顺便说一句,在您发布的伪代码中,实际上并不需要退出杀死线程,事实上,如果您将其重写为:
while loop {
if(condition) {
compute;
}
__syncthreads();
}
应该可以正常工作。
【讨论】: