class ReciprocalToPsinc(op: ReciprocalFragment) extends DensePsincFragment {
val fftbox = new DeclaredVarSymbol[ArrayType[FloatType]]("fftbox", new ArrayType[FloatType](3))
+ val dummybox = new DeclaredVarSymbol[ArrayType[FloatType]]("dummybox", new ArrayType[FloatType](3))
def toReciprocal = op
def setup(context: GenerationContext) {
op.setup(context)
context.addDeclaration(fftbox)
+ context.addDeclaration(dummybox)
val fftboxSize : Seq[Expression[IntType]] = getSize
context += new AllocateStatement(fftbox, fftboxSize)
+ context += new AllocateStatement(dummybox, fftboxSize)
- val fourierParams : Seq[Expression[_]] = Seq(new CharLiteral('C'), new CharLiteral('B'), fftbox, fftbox, op.getBuffer)
+ val fourierParams : Seq[Expression[_]] = Seq(new CharLiteral('C'), new CharLiteral('B'), fftbox, dummybox, op.getBuffer)
context += new FunctionCallStatement(new FunctionCall(OnetepFunctions.fourier_apply_box_pair, fourierParams))
op.teardown(context)
def teardown(context: GenerationContext) {
context += new DeallocateStatement(fftbox)
+ context += new DeallocateStatement(dummybox)
}
def getSize = for (dim <- 0 to 2) yield OnetepTypes.FFTBoxInfo.public % OnetepTypes.FFTBoxInfo.totalPts(dim)