summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJukka Ojanen <jukka.ojanen@linkotec.net>2015-07-02 17:04:44 +0300
committerJukka Ojanen <jukka.ojanen@linkotec.net>2015-07-02 17:04:44 +0300
commit8f0c8c7f7243a1255cfcc4d63a169c21a61200fc (patch)
treee2c3906be4f76df88cf7118d5548a30823b4a6b9
parent502acf15c749a6d32680a5843da79934f2d985d4 (diff)
downloadffts-8f0c8c7f7243a1255cfcc4d63a169c21a61200fc.zip
ffts-8f0c8c7f7243a1255cfcc4d63a169c21a61200fc.tar.gz
Incorrect stride with GCC flags "-march=native -ffast-math"
Note that N/leaf_N is always a multiply of 2
-rw-r--r--src/ffts_internal.h5
-rw-r--r--src/patterns.c3
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 <assert.h>
#include <limits.h>
@@ -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));
OpenPOWER on IntegriCloud