From 78700a67bc0cbdbf0b7209d4be8e76f726005401 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Mon, 17 Oct 2016 22:13:17 +0200 Subject: [PATCH] sawg: fast-math --- artiq/coredevice/sawg.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/artiq/coredevice/sawg.py b/artiq/coredevice/sawg.py index 2a078143d..f6f90f973 100644 --- a/artiq/coredevice/sawg.py +++ b/artiq/coredevice/sawg.py @@ -32,13 +32,13 @@ class SAWG: """ rtio_output(now_mu(), self.channel_base, 0, amplitude) - @kernel + @kernel(flags=["fast-math"]) def set_amplitude(self, amplitude: TFloat): """Set DDS amplitude. :param amplitude: DDS amplitude relative to full-scale. """ - self.set_amplitude_mu(int(amplitude*self.amplitude_scale)) + self.set_amplitude_mu(int(round(amplitude*self.amplitude_scale))) @kernel def set_frequency_mu(self, frequency: TInt32): @@ -48,13 +48,13 @@ class SAWG: """ rtio_output(now_mu(), self.channel_base + 1, 0, frequency) - @kernel + @kernel(flags=["fast-math"]) def set_frequency(self, frequency: TFloat): """Set DDS frequency. :param frequency: DDS frequency in Hz. """ - self.set_frequency_mu(int(frequency*self.frequency_scale)) + self.set_frequency_mu(int(round(frequency*self.frequency_scale))) @kernel def set_phase_mu(self, phase: TInt32): @@ -64,10 +64,10 @@ class SAWG: """ rtio_output(now_mu(), self.channel_base + 2, 0, phase) - @kernel + @kernel(flags=["fast-math"]) def set_phase(self, phase: TFloat): """Set DDS phase. :param phase: DDS phase relative in turns. """ - self.set_phase_mu(int(phase*self.phase_scale)) + self.set_phase_mu(int(round(phase*self.phase_scale)))