From 6e20d19a23042350db37f130be237b9820eeeed4 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 4 Feb 2026 10:01:43 +0000 Subject: [PATCH] Fix float literal syntax in autonomous kernel --- streaming/sexp_to_cuda.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/streaming/sexp_to_cuda.py b/streaming/sexp_to_cuda.py index 9212b7c..28719d4 100644 --- a/streaming/sexp_to_cuda.py +++ b/streaming/sexp_to_cuda.py @@ -454,19 +454,19 @@ void autonomous_pipeline( }} ''' elif op == 'ripple': - amp = effect.get('amplitude', 10) - freq = effect.get('frequency', 8) - decay = effect.get('decay', 2) - rcx = effect.get('center_x', width/2) - rcy = effect.get('center_y', height/2) + amp = float(effect.get('amplitude', 10)) + freq = float(effect.get('frequency', 8)) + decay = float(effect.get('decay', 2)) + rcx = float(effect.get('center_x', width/2)) + rcy = float(effect.get('center_y', height/2)) code += f''' // Ripple {i} {{ - float amplitude = {amp}f; - float frequency = {freq}f; - float decay_val = {decay}f; - float rcx = {rcx}f; - float rcy = {rcy}f; + float amplitude = {amp:.1f}f; + float frequency = {freq:.1f}f; + float decay_val = {decay:.1f}f; + float rcx = {rcx:.1f}f; + float rcy = {rcy:.1f}f; float rdx = src_x - rcx; float rdy = src_y - rcy; @@ -529,11 +529,11 @@ void autonomous_pipeline( op = effect['op'] if op == 'hue_shift': - degrees = effect.get('degrees', 0) + degrees = float(effect.get('degrees', 0)) code += f''' // Hue shift {i} {{ - float shift = {degrees}f; + float shift = {degrees:.1f}f; float rf = r / 255.0f; float gf = g / 255.0f; float bf = b / 255.0f;