[Scipy-svn] r4315 - in branches/refactor_fft/scipy/fftpack: . src src/mkl
scipy-svn at scipy.org
scipy-svn at scipy.org
Tue May 13 05:06:09 EDT 2008
Author: cdavid
Date: 2008-05-13 04:06:02 -0500 (Tue, 13 May 2008)
New Revision: 4315
Modified:
branches/refactor_fft/scipy/fftpack/setup.py
branches/refactor_fft/scipy/fftpack/src/fftpack.cxx
branches/refactor_fft/scipy/fftpack/src/fftpack.h
branches/refactor_fft/scipy/fftpack/src/mkl/zfft.cxx
branches/refactor_fft/scipy/fftpack/src/mkl/zfftnd.cxx
Log:
Fixing mkl backend.
Modified: branches/refactor_fft/scipy/fftpack/setup.py
===================================================================
--- branches/refactor_fft/scipy/fftpack/setup.py 2008-05-13 08:53:28 UTC (rev 4314)
+++ branches/refactor_fft/scipy/fftpack/setup.py 2008-05-13 09:06:02 UTC (rev 4315)
@@ -14,6 +14,8 @@
['zfft.cxx', 'drfft.cxx', 'zfftnd.cxx', 'convolve.cxx']]
backends_src['fftpack'] = [join('src/fftpack/', i) for i in
['zfft.cxx', 'drfft.cxx', 'zfftnd.cxx', 'convolve.cxx']]
+ backends_src['mkl'] = [join('src/mkl/', i) for i in
+ ['zfft.cxx', 'zfftnd.cxx']]
libs = []
@@ -29,6 +31,9 @@
# scipy-dev ML. If libfoo1 depends on libfoo2, -lfoo1 -lfoo2 works, but
# -lfoo2 -lfoo1 won't (and you don't know it at runtime, only at load
# time).
+ if info['mkl']:
+ build_backend('mkl', [fft_opt_info])
+
if info['djbfft']:
build_backend('djbfft', [djbfft_info])
@@ -54,6 +59,8 @@
mkl_info.setdefault('define_macros', []).append(('SCIPY_MKL_H', None))
fft_opt_info = mkl_info
info['mkl'] = True
+ # We need fftpack for convolve and real transforms
+ info['fftpack'] = True
else:
fft_opt_info = get_info('fftw3')
if fft_opt_info:
Modified: branches/refactor_fft/scipy/fftpack/src/fftpack.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftpack.cxx 2008-05-13 08:53:28 UTC (rev 4314)
+++ branches/refactor_fft/scipy/fftpack/src/fftpack.cxx 2008-05-13 09:06:02 UTC (rev 4315)
@@ -54,9 +54,7 @@
GEN_ZFFTND_API(fftw)
#endif
#elif defined WITH_MKL
-#error MKL backend not supported !
- #include "mkl/zfft.cxx"
- #include "mkl/zfftnd.cxx"
+ #include "mkl/api.h"
#ifndef WITH_DJBFFT
GEN_ZFFT_API(mkl)
GEN_ZFFTND_API(mkl)
Modified: branches/refactor_fft/scipy/fftpack/src/fftpack.h
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftpack.h 2008-05-13 08:53:28 UTC (rev 4314)
+++ branches/refactor_fft/scipy/fftpack/src/fftpack.h 2008-05-13 09:06:02 UTC (rev 4315)
@@ -42,7 +42,6 @@
#ifdef SCIPY_MKL_H
#define WITH_MKL
-#include <mkl_dfti.h>
#endif
#ifdef SCIPY_FFTW3_H
Modified: branches/refactor_fft/scipy/fftpack/src/mkl/zfft.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/mkl/zfft.cxx 2008-05-13 08:53:28 UTC (rev 4314)
+++ branches/refactor_fft/scipy/fftpack/src/mkl/zfft.cxx 2008-05-13 09:06:02 UTC (rev 4315)
@@ -1,5 +1,8 @@
#include <new>
+#include <mkl_dfti.h>
+
+#include "api.h"
#include "cycliccache.h"
using namespace fft;
@@ -52,7 +55,7 @@
CacheManager<MKLCacheId, MKLCache> zmkl_cmgr(10);
-static void zfft_mkl(complex_double * inout,
+void zfft_mkl(complex_double * inout,
int n, int direction, int howmany, int normalize)
{
int i;
Modified: branches/refactor_fft/scipy/fftpack/src/mkl/zfftnd.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/mkl/zfftnd.cxx 2008-05-13 08:53:28 UTC (rev 4314)
+++ branches/refactor_fft/scipy/fftpack/src/mkl/zfftnd.cxx 2008-05-13 09:06:02 UTC (rev 4315)
@@ -3,14 +3,28 @@
*
* Original code by David M. Cooke
*
- * Last Change: Tue May 13 12:00 PM 2008 J
+ * Last Change: Tue May 13 05:00 PM 2008 J
*/
#include <new>
+#include <mkl_dfti.h>
+
+#include "api.h"
#include "cycliccache.h"
using namespace fft;
+static int equal_dims(int rank,int *dims1,int *dims2)
+{
+ int i;
+ for (i = 0; i < rank; ++i) {
+ if (dims1[i] != dims2[i]) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
class NDMKLCacheId {
public:
NDMKLCacheId(int rank, int *dim);
@@ -157,7 +171,7 @@
static CacheManager < NDMKLCacheId, NDMKLCache > ndmkl_cmgr(10);
-extern void zfftnd_mkl(complex_double * inout, int rank,
+void zfftnd_mkl(complex_double * inout, int rank,
int *dims, int direction, int howmany,
int normalize)
{
More information about the Scipy-svn
mailing list