From: Francis Russell Date: Sat, 19 May 2012 10:36:52 +0000 (+0100) Subject: Ignore negative frequencies on converting from reciprocal to psinc. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f25c82f0c97705892a6a9a56e8a82c2d2ccb3a62;p=francis%2Fofc.git Ignore negative frequencies on converting from reciprocal to psinc. --- diff --git a/src/ofc/generators/onetep/ReciprocalToPsinc.scala b/src/ofc/generators/onetep/ReciprocalToPsinc.scala index f6b9263..db36039 100644 --- a/src/ofc/generators/onetep/ReciprocalToPsinc.scala +++ b/src/ofc/generators/onetep/ReciprocalToPsinc.scala @@ -3,17 +3,20 @@ import ofc.codegen._ 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) @@ -21,6 +24,7 @@ class ReciprocalToPsinc(op: ReciprocalFragment) extends DensePsincFragment { 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)