关于计划在cuFFT中的重用 [英] On plans reuse in cuFFT

查看:253
本文介绍了关于计划在cuFFT中的重用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能看起来像一个简单的问题,但 cufft 的用法对我并不是很清楚。

This may seem like a simple question but cufft usage is not very clear to me.

是:以下哪个实现是正确的

1)

// called in a loop
cufftPlan3d (plan1, x, y, z) ;
cufftexec (plan1, data1) ;
cufftexec (plan1, data2) ;
cufftexec (plan1, data3) ;
destroyplan(plan1)    

2)

init() //called only one time in application
{
    cufftPlan3d (plan1, x, y, z) ;
}
exec () //called many times with data changing size remains same
{
    cufftexec (plan1, data1) ;
    cufftexec (plan1, data2) ;
    cufftexec (plan1, data3) ;
}

deinit() //called only one time in application
{    
    destroyplan(plan1)    
}

3)

 cufftPlan3d (plan1, x, y, z) ;
 cufftexec (plan1, data1) ;
 destroyplan(plan1) 

 cufftPlan3d (plan2, x, y, z) ;
 cufftexec (plan2, data2) ;
 destroyplan(plan2) 

 ....
  ...


b $ b

假设 data1 data2 data3 是相同的。请忽略语法的正确性。我只需要一个概念答案。

Assume all the data sizes of data1, data2 and data3 are same. Please ignore the correctness of the syntax. I just need a conceptual answer.

第三个实现对我看起来不正确...

The third implementation doesn't look correct to me...

推荐答案

我认为所有3都可以工作。方法2可能是最快的,只要计划符合data1,data2和data3中的每一个的数据。

I think all 3 can be made to work. Method 2 will probably be fastest, as long as the plan fits the data for each of data1, data2, and data3.

您可以多次重复使用计划想要,只要你的转换意图不改变。

You can reuse a plan as many times as you want, as long as your transform intent doesn't change.

这篇关于关于计划在cuFFT中的重用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆