From 8f0c8c7f7243a1255cfcc4d63a169c21a61200fc Mon Sep 17 00:00:00 2001 From: Jukka Ojanen Date: Thu, 2 Jul 2015 17:04:44 +0300 Subject: Incorrect stride with GCC flags "-march=native -ffast-math" Note that N/leaf_N is always a multiply of 2 --- src/ffts_internal.h | 5 +++-- src/patterns.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ffts_internal.h b/src/ffts_internal.h index 60de539..18b3bd5 100644 --- a/src/ffts_internal.h +++ b/src/ffts_internal.h @@ -79,7 +79,8 @@ #define M_PI 3.1415926535897932384626433832795028841971693993751058209 #endif -typedef void (*transform_func_t)(ffts_plan_t *p, const void *in, void *out); +struct _ffts_plan_t; +typedef void (*transform_func_t)(struct _ffts_plan_t *p, const void *in, void *out); /** * Contains all the Information need to perform FFT @@ -172,7 +173,7 @@ struct _ffts_plan_t { * to clean up the plan after use * (differs for real and multi dimension transforms */ - void (*destroy)(ffts_plan_t *); + void (*destroy)(struct _ffts_plan_t *); /** * Coefficiants for the real valued transforms diff --git a/src/patterns.c b/src/patterns.c index 04bdccb..158ff89 100644 --- a/src/patterns.c +++ b/src/patterns.c @@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "patterns.h" +#include "ffts_internal.h" #include #include @@ -113,7 +114,7 @@ static void ffts_hardcodedleaf_is_rec(ptrdiff_t **is, int big_N, int N, int poff ptrdiff_t *ffts_init_is(size_t N, size_t leaf_N, int VL) { int i, i0, i1, i2; - int stride = (int) (log(N/leaf_N) / log(2)); + int stride = ffts_ctzl(N/leaf_N); ptrdiff_t *is, *pis; is = malloc(N / VL * sizeof(*is)); -- cgit v1.1