這可能看起來像一個簡單的問題,但cufft
的用法對我來說不是很清楚。關於cuFFT中重複使用的計劃
我的問題是:哪一個下面的實現是正確的?
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)
....
...
假設的data1
,data2
和data3
是相同的所有數據的大小。請忽略語法的正確性。我只需要一個概念性的答案。
第三個實現不看起來是正確的,我...
在選項2中可以使用createPlan3D()創建計劃並根據需要多次使用它? –
是的,你可以重複使用計劃 –