diff options
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fft_vcc.cc | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fft_vcc.h | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fft_vcc.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fft_vfc.cc | 27 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fft_vfc.h | 17 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_fft_vfc.i | 12 |
6 files changed, 47 insertions, 15 deletions
diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.cc b/gnuradio-core/src/lib/general/gr_fft_vcc.cc index 64dda2491..f744acb93 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.h b/gnuradio-core/src/lib/general/gr_fft_vcc.h index 6c3985987..ceabeb681 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.h +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.i b/gnuradio-core/src/lib/general/gr_fft_vcc.i index 0dc5353b2..26d8b89a3 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008,2010 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.cc b/gnuradio-core/src/lib/general/gr_fft_vfc.cc index 561c63740..5fbe732dc 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -40,12 +40,17 @@ gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> &window) +gr_make_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads) { - return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, window)); + return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, + window, nthreads)); } -gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector<float> &window) +gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads) : gr_sync_block ("fft_vfc", gr_make_io_signature (1, 1, fft_size * sizeof (float)), gr_make_io_signature (1, 1, fft_size * sizeof (gr_complex))), @@ -56,7 +61,7 @@ gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector<float> &wi throw std::invalid_argument ("fft_vfc: forward must == true"); } - d_fft = new gri_fft_complex (d_fft_size, forward); + d_fft = new gri_fft_complex (d_fft_size, forward, nthreads); set_window(window); } @@ -66,6 +71,18 @@ gr_fft_vfc::~gr_fft_vfc () delete d_fft; } +void +gr_fft_vfc::set_nthreads(int n) +{ + d_fft->set_nthreads(n); +} + +int +gr_fft_vfc::nthreads() const +{ + return d_fft->nthreads(); +} + int gr_fft_vfc::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.h b/gnuradio-core/src/lib/general/gr_fft_vfc.h index 6cf6b9037..84ae08f08 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.h +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,9 @@ class gr_fft_vfc; typedef boost::shared_ptr<gr_fft_vfc> gr_fft_vfc_sptr; GR_CORE_API gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> &window); +gr_make_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads=1); /*! * \brief Compute forward FFT. float vector in / complex vector out. @@ -42,17 +44,24 @@ gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> &window); class GR_CORE_API gr_fft_vfc : public gr_sync_block { friend GR_CORE_API gr_fft_vfc_sptr - gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> &window); + gr_make_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads); unsigned int d_fft_size; std::vector<float> d_window; gri_fft_complex *d_fft; - gr_fft_vfc (int fft_size, bool forward, const std::vector<float> &window); + gr_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads=1); public: ~gr_fft_vfc (); + void set_nthreads(int n); + int nthreads() const; + int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.i b/gnuradio-core/src/lib/general/gr_fft_vfc.i index 149745b58..4783ae1fe 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,14 +23,20 @@ GR_SWIG_BLOCK_MAGIC(gr, fft_vfc) gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> &window) +gr_make_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads=1) throw(std::exception); class gr_fft_vfc : public gr_sync_block { protected: - gr_fft_vfc (int fft_size, bool forward, const std::vector<float> &window); + gr_fft_vfc (int fft_size, bool forward, + const std::vector<float> &window, + int nthreads=1); public: bool set_window(const std::vector<float> &window); + void set_nthreads(int n); + int nthreads() const; }; |