CUDA程序运行时间过长,报错:the launch timed out and was terminated
一个三层循环的程序,我将它改写成一成循环的CUDA程序,但是由于该程序循环次数过多,光在CPU上运行就几个小时,改成CUDA程序过后,就一直报错:the launch timed out and was terminated。经我GOOGLE,网上有人说是运行时间过长,在win7上GPU核心函数一次运行时间不能超过5秒(我用的就是win7),然后我就将kernel函数用for循环改成多次运行,如果只循环一次就没问题,多次循环就报错。希望有人能帮我解决这个问题,谢了。将
CUDAKernel<<<grid,threads,1>>>(…;
)
报错:the launch timed out and was terminated。
改为多次执行
for(i=0; i<n; i++)
{
CUDAKernel<<<grid,threads,1>>>(…; i)
}
当n=1是程序能正常运行,但n增大的时候,就开始报错了
:the launch timed out and was terminated。