From 4defc0e618b04ceb71091ab3e3df62ca3e4858d8 Mon Sep 17 00:00:00 2001 From: Marcus Leech Date: Mon, 6 Feb 2012 11:11:06 -0500 Subject: core: enable use of fftw's threading capabilities. Can set nthreads when creating an fftw class; defaults to 1, so there's no change in default behavior. --- gnuradio-core/src/lib/general/gri_fft.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnuradio-core/src/lib/general/gri_fft.h') diff --git a/gnuradio-core/src/lib/general/gri_fft.h b/gnuradio-core/src/lib/general/gri_fft.h index 91a82fb55..c09930db0 100644 --- a/gnuradio-core/src/lib/general/gri_fft.h +++ b/gnuradio-core/src/lib/general/gri_fft.h @@ -49,12 +49,13 @@ public: */ class GR_CORE_API gri_fft_complex { int d_fft_size; + int d_nthreads; gr_complex *d_inbuf; gr_complex *d_outbuf; void *d_plan; public: - gri_fft_complex (int fft_size, bool forward = true); + gri_fft_complex (int fft_size, bool forward = true, int nthreads=1); virtual ~gri_fft_complex (); /* @@ -80,12 +81,13 @@ public: */ class GR_CORE_API gri_fft_real_fwd { int d_fft_size; + int d_nthreads; float *d_inbuf; gr_complex *d_outbuf; void *d_plan; public: - gri_fft_real_fwd (int fft_size); + gri_fft_real_fwd (int fft_size, int nthreads=1); virtual ~gri_fft_real_fwd (); /* @@ -111,12 +113,13 @@ public: */ class GR_CORE_API gri_fft_real_rev { int d_fft_size; + int d_nthreads; gr_complex *d_inbuf; float *d_outbuf; void *d_plan; public: - gri_fft_real_rev (int fft_size); + gri_fft_real_rev (int fft_size, int nthreads=1); virtual ~gri_fft_real_rev (); /* -- cgit From 9efac71df2d352878e86df54889973b5cf9164bf Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 6 Feb 2012 12:01:57 -0500 Subject: core: add functions to set/get nthreads of gri FFT object. --- gnuradio-core/src/lib/general/gri_fft.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gnuradio-core/src/lib/general/gri_fft.h') diff --git a/gnuradio-core/src/lib/general/gri_fft.h b/gnuradio-core/src/lib/general/gri_fft.h index c09930db0..ed80badf1 100644 --- a/gnuradio-core/src/lib/general/gri_fft.h +++ b/gnuradio-core/src/lib/general/gri_fft.h @@ -69,6 +69,16 @@ public: int inbuf_length () const { return d_fft_size; } int outbuf_length () const { return d_fft_size; } + /*! + * Set the number of threads to use for caclulation. + */ + void set_nthreads(int n); + + /*! + * Get the number of threads being used by FFTW + */ + int nthreads() const { return d_nthreads; } + /*! * compute FFT. The input comes from inbuf, the output is placed in outbuf. */ @@ -101,6 +111,16 @@ public: int inbuf_length () const { return d_fft_size; } int outbuf_length () const { return d_fft_size / 2 + 1; } + /*! + * Set the number of threads to use for caclulation. + */ + void set_nthreads(int n); + + /*! + * Get the number of threads being used by FFTW + */ + int nthreads() const { return d_nthreads; } + /*! * compute FFT. The input comes from inbuf, the output is placed in outbuf. */ @@ -133,6 +153,16 @@ public: int inbuf_length () const { return d_fft_size / 2 + 1; } int outbuf_length () const { return d_fft_size; } + /*! + * Set the number of threads to use for caclulation. + */ + void set_nthreads(int n); + + /*! + * Get the number of threads being used by FFTW + */ + int nthreads() const { return d_nthreads; } + /*! * compute FFT. The input comes from inbuf, the output is placed in outbuf. */ -- cgit