cufftPlanMany usage (strange results)

I’m trying to use cufftPlanMany but the results are strange and the documentation partial.

For batch R2C transform, how are the vectors supposed to be packed?

If the input real vector size is 4096 floats, the half complex output size should be 4096/2+1 = 2049 cufftComplex or 4098 floats.

Should the input vectors be at an offset of 4096 floats or 4098 floats?

I’m defining the plan (regular vs. many)

[codebox]

cufftHandle plan;

cufftPlan1d(&plan, veclen, CUFFT_R2C, 1);

cufftHandle planBatch;

cufftPlanMany(&planBatch, 1, &veclen, NULL, 1, 0, NULL, 1, 0, CUFFT_R2C, numvecs);

[/codebox]

Doing single multiple single ffts (hoping I’m doing this correctly):

[codebox]

for (int i = 0 ; i < numvecs ; i++)

cufftExecR2C(plan,(cufftReal *)data + veclen*i, data + (veclen/2 + 1)*i);

[/codebox]

It looks like it’s sensitive to input offset but not output offset, will take 4096 floats but not 4098 floats (error in cutilsafecall)

Trying to do batched transform seems to give strange, results, is this the right way to call it?

[codebox]

cufftExecR2C(planBatch,(cufftReal *)data, data);

[/codebox]

Thanks

Seem to have solved it, it’s an issue of using the correct offset. Need to use an offset of 4098 in this case also for the input vectors

Seem to have solved it, it’s an issue of using the correct offset. Need to use an offset of 4098 in this case also for the input vectors