diff options
author | waker <wakeroid@gmail.com> | 2011-02-12 13:24:51 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-02-12 13:25:46 +0100 |
commit | 40073ef868e09e86480f5331ef5bc95bf7de3347 (patch) | |
tree | f5ff3707f39d7462b2ff4d4e10dee7339a48b584 /plugins/supereq/shibatch_rdft.c | |
parent | a70bbf6c7a6896e3bc97177cab68b5cb96091868 (diff) |
added Shibatch nsfft lib support to supereq
Diffstat (limited to 'plugins/supereq/shibatch_rdft.c')
-rw-r--r-- | plugins/supereq/shibatch_rdft.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/supereq/shibatch_rdft.c b/plugins/supereq/shibatch_rdft.c new file mode 100644 index 00000000..2a352f7e --- /dev/null +++ b/plugins/supereq/shibatch_rdft.c @@ -0,0 +1,39 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <stdint.h> + +#include "SIMDBase.h" +#include "DFT.h" + +typedef float REAL; +#define TYPE SIMDBase_TYPE_FLOAT + +void rfft(int n,int isign,REAL *x) { + static DFT *p = NULL; + static int ipsize = 0; + static int mode = 0; + int newipsize; + if (n == 0) { + if (p) { + DFT_dispose(p, mode); + p = NULL; + } + return; + } + n = 1 << n; + newipsize = 2+sqrt(n/2); + if (newipsize > ipsize) { + ipsize = newipsize; + + if (p) { + DFT_dispose(p, mode); + p = NULL; + } + + mode = SIMDBase_chooseBestMode(TYPE); + p = DFT_init(mode, n, 0); + } + + DFT_execute(p, mode, x, 1); +} |