小编Mer*_*iko的帖子

cuFFT和流

我正在尝试使用流异步启动多个CUDA FFT内核.为此,我正在创建我的流,cuFFT前向和反向计划如下:

streams = (cudaStream_t*) malloc(sizeof(cudaStream_t)*streamNum);
plansF = (cufftHandle *) malloc(sizeof(cufftHandle)*streamNum);
plansI = (cufftHandle *) malloc(sizeof(cufftHandle)*streamNum);
for(int i=0; i<streamNum; i++)  
{
    cudaStreamCreate(&streams[i]);
    CHECK_ERROR(5)
    cufftPlan1d(&plansF[i], ticks, CUFFT_R2C,1);
    CHECK_ERROR(5)
    cufftPlan1d(&plansI[i], ticks, CUFFT_C2R,1);
    CHECK_ERROR(5)
    cufftSetStream(plansF[i],streams[i]);
    CHECK_ERROR(5)
    cufftSetStream(plansI[i],streams[i]);
    CHECK_ERROR(5)
}
Run Code Online (Sandbox Code Playgroud)

main函数中,我正在启动正向FFT,如下所示:

for(w=1;w<q;w++)
  {
    cufftExecR2C(plansF[w], gpuMem1+k,gpuMem2+j);
    CHECK_ERROR(8)
    k += rect_small_real;
    j += rect_small_complex;
  }
Run Code Online (Sandbox Code Playgroud)

我还有其他内核,我使用相同的流异步启动.

当我使用Visual Profiler 5.0分析我的应用程序时,我发现除了CUDA FFT(正向和反向)之外的所有内核并行运行并重叠.FFT内核确实在不同的流中运行,但它们不重叠,因为它们实际上是顺序运行的.谁能告诉我我的问题是什么?

我的环境是VS 2008,64位,Windows 7.

谢谢.

cuda fft

7
推荐指数
2
解决办法
3910
查看次数

标签 统计

cuda ×1

fft ×1