Coincidently I was thinking about how to clean up plan creation earlier today as I was learning about some new partial instantiation features in 1.20 ('partial instantiation' section of https://chapel-lang.org/releaseNotes/1.20/01-language.pdf)
With that, I was wondering if we could avoid some of the duplicate array and ft Type stuff and push the setup logic into an initializer. Something roughly like:
record FFTWplan {
type arrType;
param ftType: FFTtype;
...
proc init(dom: domain, numTransforms: int, signOrKind, flags : c_uint = FFTW_MEASURE) {
...
}
}
type Plan = FFTWplan(T, ftType);
var xPlan = new Plan({xDst, zSrc}, 1, signOrKind);
var yPlan = new Plan({ySrc, zSrc}, 1, signOrKind);
var zPlan = new Plan({zSrc}, 1, signOrKind);
But anyway, I think what's here is a nice cleanup, just some misc thoughts I had earlier today.
See notes from @ronawho below...
Coincidently I was thinking about how to clean up plan creation earlier today as I was learning about some new partial instantiation features in 1.20 ('partial instantiation' section of https://chapel-lang.org/releaseNotes/1.20/01-language.pdf)
With that, I was wondering if we could avoid some of the duplicate array and ft Type stuff and push the setup logic into an initializer. Something roughly like:
But anyway, I think what's here is a nice cleanup, just some misc thoughts I had earlier today.
Originally posted by @ronawho in https://github.com/npadmana/DistributedFFT/pull/52#issuecomment-542465816