From 28aa023d633ba682b7f02d3830ae5033fba44d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Brito?= <50997716+antmsbrito@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:34:21 +0000 Subject: [PATCH] Define value of pi --- .../nanopyx.core.transform._le_interpolation_lanczos_.cl | 2 +- src/nanopyx/core/transform/_le_interpolation_lanczos_.cl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mako_templates/nanopyx.core.transform._le_interpolation_lanczos_.cl b/src/mako_templates/nanopyx.core.transform._le_interpolation_lanczos_.cl index c77b8031..12ec6d11 100644 --- a/src/mako_templates/nanopyx.core.transform._le_interpolation_lanczos_.cl +++ b/src/mako_templates/nanopyx.core.transform._le_interpolation_lanczos_.cl @@ -9,7 +9,7 @@ c_function_names = [('_c_interpolation_lanczos.c','_c_lanczos_kernel'),('_c_inte headers, functions = extract_batch_code(c_function_names) -defines = [('TAPS',4),('HALF_TAPS',2)] +defines = [('TAPS',4),('HALF_TAPS',2),('M_PI','3.14159265359f')] %> diff --git a/src/nanopyx/core/transform/_le_interpolation_lanczos_.cl b/src/nanopyx/core/transform/_le_interpolation_lanczos_.cl index 1749d66f..7f2f719f 100644 --- a/src/nanopyx/core/transform/_le_interpolation_lanczos_.cl +++ b/src/nanopyx/core/transform/_le_interpolation_lanczos_.cl @@ -3,6 +3,7 @@ float _c_interpolate(__global float *image, float r, float c, int rows, int cols #define TAPS 4 #define HALF_TAPS 2 +#define M_PI 3.14159265359f double _c_lanczos_kernel(double v) { if (v == 0) {