This may seem like a simple question but cufft
usage is not very clear to me.
My question is: which one of the following implementations is correct?
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)
....
...
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...