From 0a4a01a1068faa7239305d2bd67b341f407590e4 Mon Sep 17 00:00:00 2001 From: Ben Reynwar Date: Sun, 17 Mar 2013 22:30:20 -0700 Subject: docs: Adding gr-uhd to sphinx docs. --- docs/sphinx/source/index.rst | 13 +++++++++++++ docs/sphinx/source/uhd.rst | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 docs/sphinx/source/uhd.rst diff --git a/docs/sphinx/source/index.rst b/docs/sphinx/source/index.rst index 38d859aaf..783b5af7e 100644 --- a/docs/sphinx/source/index.rst +++ b/docs/sphinx/source/index.rst @@ -38,6 +38,19 @@ Core Framework gnuradio.qtgui gnuradio.wxgui +Harware Interfaces +------------------ + +.. autosummary:: + :nosignatures: + + gnuradio.uhd + +.. toctree:: + :hidden: + + gnuradio.uhd + Utilities --------- diff --git a/docs/sphinx/source/uhd.rst b/docs/sphinx/source/uhd.rst new file mode 100644 index 000000000..92f4bdc8c --- /dev/null +++ b/docs/sphinx/source/uhd.rst @@ -0,0 +1,9 @@ +gnuradio.uhd +============ + +.. automodule:: gnuradio.uhd + +.. autooldblock:: gnuradio.uhd.usrp_sink +.. autooldblock:: gnuradio.uhd.usrp_source +.. autooldblock:: gnuradio.uhd.amsg_source + -- cgit From 456790ef73c859c10bca0a1d18da7d00aaed47f0 Mon Sep 17 00:00:00 2001 From: Ben Reynwar Date: Sun, 17 Mar 2013 22:40:15 -0700 Subject: sphinx docs: Added additional block function names to blacklist so that they are not displayed for every block. --- docs/sphinx/gnuradio_sphinx.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/gnuradio_sphinx.py b/docs/sphinx/gnuradio_sphinx.py index e8ca867f8..06a3150c4 100644 --- a/docs/sphinx/gnuradio_sphinx.py +++ b/docs/sphinx/gnuradio_sphinx.py @@ -107,7 +107,32 @@ common_block_members =[ 'to_basic_block', 'unique_id', 'make', - ] + 'alias', + 'is_set_max_noutput_items', + 'max_noutput_items', + 'max_output_buffer', + 'message_ports_in', + 'message_ports_out', + 'min_output_buffer', + 'pc_input_buffers_full', + 'pc_input_buffers_full_var', + 'pc_noutput_items', + 'pc_noutput_items_var', + 'pc_nproduced', + 'pc_nproduced_var', + 'pc_output_buffers_full', + 'pc_output_buffers_full_var', + 'pc_work_time', + 'pc_work_time_var', + 'processor_affinity', + 'set_block_alias', + 'set_max_noutput_items', + 'unset_max_noutput_items', + 'set_max_output_buffer', + 'set_min_output_buffer', + 'set_processor_affinity', + 'symbol_name', + 'unset_processor_affinity', ] class OldBlockDocumenter(FunctionDocumenter): """ -- cgit From bc79c5b78793caf198340ef2504ba07d0ddc3960 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Mon, 18 Mar 2013 09:39:28 -0700 Subject: volk: fixed MSVC include directory --- volk/apps/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/volk/apps/CMakeLists.txt b/volk/apps/CMakeLists.txt index 03ad92b79..8306f1e46 100644 --- a/volk/apps/CMakeLists.txt +++ b/volk/apps/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2011-2012 Free Software Foundation, Inc. +# Copyright 2011-2013 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ if(Boost_FOUND) if(MSVC) - include_directories(${CMAKE_SOURCE_DIR}/msvc) + include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc) endif(MSVC) include_directories( -- cgit From be043a9cf70b285c98254b40228ef161896d3862 Mon Sep 17 00:00:00 2001 From: Ben Reynwar Date: Mon, 18 Mar 2013 11:11:54 -0700 Subject: sphinx docs: Adding more classes to uhd sphinx docs. --- docs/sphinx/source/index.rst | 2 +- docs/sphinx/source/uhd.rst | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/index.rst b/docs/sphinx/source/index.rst index 783b5af7e..eafebc8d0 100644 --- a/docs/sphinx/source/index.rst +++ b/docs/sphinx/source/index.rst @@ -38,7 +38,7 @@ Core Framework gnuradio.qtgui gnuradio.wxgui -Harware Interfaces +Hardware Interfaces ------------------ .. autosummary:: diff --git a/docs/sphinx/source/uhd.rst b/docs/sphinx/source/uhd.rst index 92f4bdc8c..d9ecf3a51 100644 --- a/docs/sphinx/source/uhd.rst +++ b/docs/sphinx/source/uhd.rst @@ -6,4 +6,13 @@ gnuradio.uhd .. autooldblock:: gnuradio.uhd.usrp_sink .. autooldblock:: gnuradio.uhd.usrp_source .. autooldblock:: gnuradio.uhd.amsg_source +.. autoclass:: gnuradio.uhd.stream_cmd_t +.. autoclass:: gnuradio.uhd.time_spec_t +.. autoclass:: gnuradio.uhd.meta_range_t +.. autoclass:: gnuradio.uhd.stream_args_t +.. autoclass:: gnuradio.uhd.device_addr_t +.. autoclass:: gnuradio.uhd.tune_request_t +.. autoclass:: gnuradio.uhd.tune_result_t +.. autoclass:: gnuradio.uhd.sensor_value_t + -- cgit From 5f69899e059e9bea58f92af61f70fc3f63825087 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 18 Mar 2013 12:54:59 -0700 Subject: Update revision to 3.6.4.1 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b81d76ce8..16e4ef378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,8 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) # Set the version information here set(VERSION_INFO_MAJOR_VERSION 3) set(VERSION_INFO_API_COMPAT 6) -set(VERSION_INFO_MINOR_VERSION 5) -set(VERSION_INFO_MAINT_VERSION git) +set(VERSION_INFO_MINOR_VERSION 4) +set(VERSION_INFO_MAINT_VERSION 1) include(GrVersion) #setup version info # Append -O2 optimization flag for Debug builds -- cgit From 02484c4d8880b317e92077748e48989e0c0c0b34 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Wed, 20 Mar 2013 09:55:25 -0400 Subject: wxgui: fix scaling issue of nongl FFT plot (issue #523). wxgui: add some noise to the fftsink_nongl test case. --- gr-wxgui/src/python/fftsink_nongl.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gr-wxgui/src/python/fftsink_nongl.py b/gr-wxgui/src/python/fftsink_nongl.py index c756d8a3b..c38abbb22 100644 --- a/gr-wxgui/src/python/fftsink_nongl.py +++ b/gr-wxgui/src/python/fftsink_nongl.py @@ -132,7 +132,7 @@ class fft_sink_f(gr.hier_block2, fft_sink_base): # FIXME We need to add 3dB to all bins but the DC bin self.log = gr.nlog10_ff(20, self.fft_size, - -10*math.log10(self.fft_size) # Adjust for number of bins + -20*math.log10(self.fft_size) # Adjust for number of bins -10*math.log10(power/self.fft_size) # Adjust for windowing loss -20*math.log10(ref_scale/2)) # Adjust for reference scale @@ -177,7 +177,7 @@ class fft_sink_c(gr.hier_block2, fft_sink_base): # FIXME We need to add 3dB to all bins but the DC bin self.log = gr.nlog10_ff(20, self.fft_size, - -10*math.log10(self.fft_size) # Adjust for number of bins + -20*math.log10(self.fft_size) # Adjust for number of bins -10*math.log10(power/self.fft_size) # Adjust for windowing loss -20*math.log10(ref_scale/2)) # Adjust for reference scale @@ -606,6 +606,8 @@ class test_app_block (stdgui2.std_top_block): # Generate a complex sinusoid #src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 100*2e3, 1) src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 100*5.75e3, 1) + noise1 = analog.noise_source_c(analog.GR_UNIFORM, 1.0/10) + add1 = blocks.add_cc() # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. @@ -616,17 +618,24 @@ class test_app_block (stdgui2.std_top_block): ref_level=0, y_per_div=20, y_divs=10) vbox.Add (sink1.win, 1, wx.EXPAND) - self.connect(src1, thr1, sink1) + self.connect(src1, (add1,0)) + self.connect(noise1, (add1,1)) + self.connect(add1, thr1, sink1) #src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 100*2e3, 1) src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 100*5.75e3, 1) + noise2 = analog.noise_source_f(analog.GR_UNIFORM, 1.0/10) + add2 = blocks.add_ff() + thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = fft_sink_f (panel, title="Real Data", fft_size=fft_size*2, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20, y_divs=10) vbox.Add (sink2.win, 1, wx.EXPAND) - self.connect(src2, thr2, sink2) + self.connect(src2, (add2,0)) + self.connect(noise2, (add2,1)) + self.connect(add2, thr2, sink2) def main (): app = stdgui2.stdapp (test_app_block, "FFT Sink Test App") -- cgit From c928376d8b24e0a96bf0f39da9c2e55d9771c41a Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 24 Mar 2013 07:49:40 -0700 Subject: blocks: fix XML wrapper for gr::blocks::complex_to_real --- gr-blocks/grc/blocks_complex_to_real.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gr-blocks/grc/blocks_complex_to_real.xml b/gr-blocks/grc/blocks_complex_to_real.xml index 0fe77dc1c..6737f1da3 100644 --- a/gr-blocks/grc/blocks_complex_to_real.xml +++ b/gr-blocks/grc/blocks_complex_to_real.xml @@ -24,13 +24,7 @@ re - real + float $vlen - - im - real - $vlen - 1 - -- cgit From ce52bd370c0b13ed4de11df08168768dec327497 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 26 Mar 2013 13:27:29 -0400 Subject: grc: fixes problem with order of defining message ports vs. data ports. --- grc/python/Port.py | 1 + 1 file changed, 1 insertion(+) diff --git a/grc/python/Port.py b/grc/python/Port.py index 738a33ba7..9e9f5676e 100644 --- a/grc/python/Port.py +++ b/grc/python/Port.py @@ -90,6 +90,7 @@ class Port(_Port, _GUIPort): """ self._n = n if n['type'] == 'msg': n['key'] = 'msg' + if n['type'] == 'message': n['key'] = n['name'] if dir == 'source' and not n.find('key'): n['key'] = str(block._source_count) block._source_count += 1 -- cgit From 71803b9ae55e688476f24637713a89ab6bd2cf17 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 26 Mar 2013 13:27:53 -0400 Subject: affinity: fixes a problem with using gr types (for uint8 vectors) in setting processor affinity. --- gnuradio-core/src/examples/mp-sched/affinity_set.py | 9 +++------ gnuradio-core/src/lib/swig/gnuradio.i | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gnuradio-core/src/examples/mp-sched/affinity_set.py b/gnuradio-core/src/examples/mp-sched/affinity_set.py index 6db632e0f..d73d4fc42 100755 --- a/gnuradio-core/src/examples/mp-sched/affinity_set.py +++ b/gnuradio-core/src/examples/mp-sched/affinity_set.py @@ -42,9 +42,6 @@ class affinity_set(gr.top_block): self.connect((self.gr_filt_0, 0), (self.gr_filt_1, 0)) self.connect((self.gr_filt_1, 0), (self.gr_null_sink_0, 0)) - - # QT sink close method reimplementation - def get_samp_rate(self): return self.samp_rate @@ -58,16 +55,16 @@ if __name__ == '__main__': tb.start() while(1): - ret = raw_input('Press Enter to quit: ') + ret = raw_input('Enter a new Core # or Press Enter to quit: ') if(len(ret) == 0): tb.stop() sys.exit(0) elif(ret.lower() == "none"): - tb.gr_filt_0.unset_processor_affinity() + tb.filter_filt_0.unset_processor_affinity() else: try: n = int(ret) except ValueError: print "Invalid number" else: - tb.gr_filt_0.set_processor_affinity([n,]) + tb.filter_filt_0.set_processor_affinity([n,]) diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i index 3a421ad5d..0f02554c9 100644 --- a/gnuradio-core/src/lib/swig/gnuradio.i +++ b/gnuradio-core/src/lib/swig/gnuradio.i @@ -44,6 +44,7 @@ // local file %include +%include %include %include %include -- cgit From 2ac932c60b4764511310deca5a236749ec0db76b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 26 Mar 2013 13:30:40 -0400 Subject: core: fixed block names conflict from next. --- gnuradio-core/src/examples/mp-sched/affinity_set.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnuradio-core/src/examples/mp-sched/affinity_set.py b/gnuradio-core/src/examples/mp-sched/affinity_set.py index d73d4fc42..65e929051 100755 --- a/gnuradio-core/src/examples/mp-sched/affinity_set.py +++ b/gnuradio-core/src/examples/mp-sched/affinity_set.py @@ -60,11 +60,11 @@ if __name__ == '__main__': tb.stop() sys.exit(0) elif(ret.lower() == "none"): - tb.filter_filt_0.unset_processor_affinity() + tb.gr_filt_0.unset_processor_affinity() else: try: n = int(ret) except ValueError: print "Invalid number" else: - tb.filter_filt_0.set_processor_affinity([n,]) + tb.gr_filt_0.set_processor_affinity([n,]) -- cgit From 91714eaa1fd33f4f801a9a8dedbd6832c01b1204 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Wed, 27 Mar 2013 15:33:35 -0400 Subject: utils: fixed wording in modtool for 'float' sink/source type. --- gr-utils/src/python/modtool/templates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gr-utils/src/python/modtool/templates.py b/gr-utils/src/python/modtool/templates.py index 87eb9f470..58617336e 100644 --- a/gr-utils/src/python/modtool/templates.py +++ b/gr-utils/src/python/modtool/templates.py @@ -473,7 +473,7 @@ Templates['grc_xml'] = ''' * optional (set to 1 for optional inputs) --> in - + out - + ''' -- cgit From 78cd4026c0a9b902162e94905b60a9dd44a07bb7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 29 Mar 2013 13:12:36 -0400 Subject: core: addressing issue #529. Using vector instead of vector for affinity mask vector. This is wrong as the mask should be unsigned, but necessary for SWIG to work cleanly on both 32-bit and 64-bit platforms. --- gnuradio-core/src/lib/runtime/gr_block.cc | 2 +- gnuradio-core/src/lib/runtime/gr_block.h | 8 ++-- gnuradio-core/src/lib/runtime/gr_block.i | 4 +- gnuradio-core/src/lib/runtime/gr_block_detail.cc | 2 +- gnuradio-core/src/lib/runtime/gr_block_detail.h | 4 +- gnuradio-core/src/lib/runtime/qa_gr_top_block.cc | 2 +- .../src/python/gnuradio/gr/qa_affinity.py | 49 ++++++++++++++++++++++ gruel/src/include/gruel/thread.h | 6 +-- gruel/src/lib/thread.cc | 40 +++++++++--------- 9 files changed, 83 insertions(+), 34 deletions(-) create mode 100644 gnuradio-core/src/python/gnuradio/gr/qa_affinity.py diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc index 54d267620..587e9d195 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_block.cc @@ -253,7 +253,7 @@ gr_block::is_set_max_noutput_items() } void -gr_block::set_processor_affinity(const std::vector &mask) +gr_block::set_processor_affinity(const std::vector &mask) { d_affinity = mask; if(d_detail) { diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h index 0783e8684..c5e510c3b 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.h +++ b/gnuradio-core/src/lib/runtime/gr_block.h @@ -458,9 +458,9 @@ class GR_CORE_API gr_block : public gr_basic_block { /*! * \brief Set the thread's affinity to processor core \p n. * - * \param mask a vector of unsigned ints of the core numbers available to this block. + * \param mask a vector of ints of the core numbers available to this block. */ - void set_processor_affinity(const std::vector &mask); + void set_processor_affinity(const std::vector &mask); /*! * \brief Remove processor affinity to a specific core. @@ -470,7 +470,7 @@ class GR_CORE_API gr_block : public gr_basic_block { /*! * \brief Get the current processor affinity. */ - std::vector processor_affinity() { return d_affinity; } + std::vector processor_affinity() { return d_affinity; } // ---------------------------------------------------------------------------- @@ -488,7 +488,7 @@ class GR_CORE_API gr_block : public gr_basic_block { int d_max_noutput_items; // value of max_noutput_items for this block int d_min_noutput_items; tag_propagation_policy_t d_tag_propagation_policy; // policy for moving tags downstream - std::vector d_affinity; // thread affinity proc. mask + std::vector d_affinity; // thread affinity proc. mask protected: gr_block (void){} //allows pure virtual interface sub-classes diff --git a/gnuradio-core/src/lib/runtime/gr_block.i b/gnuradio-core/src/lib/runtime/gr_block.i index a80f64d02..a53489f9a 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.i +++ b/gnuradio-core/src/lib/runtime/gr_block.i @@ -83,9 +83,9 @@ class gr_block : public gr_basic_block { float pc_work_time_var(); // Methods to manage processor affinity. - void set_processor_affinity(const gr_vector_uint &mask); + void set_processor_affinity(const std::vector &mask); void unset_processor_affinity(); - gr_vector_uint processor_affinity(); + std::vector processor_affinity(); // internal use gr_block_detail_sptr detail () const { return d_detail; } diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.cc b/gnuradio-core/src/lib/runtime/gr_block_detail.cc index 82081039a..af80e61cf 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_detail.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_detail.cc @@ -215,7 +215,7 @@ gr_block_detail::get_tags_in_range(std::vector &v, } void -gr_block_detail::set_processor_affinity(const std::vector &mask) +gr_block_detail::set_processor_affinity(const std::vector &mask) { if(threaded) { try { diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.h b/gnuradio-core/src/lib/runtime/gr_block_detail.h index 32a01e763..15d85135a 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_detail.h +++ b/gnuradio-core/src/lib/runtime/gr_block_detail.h @@ -159,9 +159,9 @@ class GR_CORE_API gr_block_detail { /*! * \brief Set core affinity of block to the cores in the vector mask. * - * \param mask a vector of unsigned ints of the core numbers available to this block. + * \param mask a vector of ints of the core numbers available to this block. */ - void set_processor_affinity(const std::vector &mask); + void set_processor_affinity(const std::vector &mask); /*! * \brief Unset core affinity. diff --git a/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc b/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc index 1d3dafadf..6bbc9ceb8 100644 --- a/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc +++ b/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc @@ -269,7 +269,7 @@ void qa_gr_top_block::t11_set_block_affinity() gr_block_sptr src (gr_make_null_source(sizeof(float))); gr_block_sptr snk (gr_make_null_sink(sizeof(float))); - std::vector set(1, 0), ret; + std::vector set(1, 0), ret; src->set_processor_affinity(set); tb->connect(src, 0, snk, 0); diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_affinity.py b/gnuradio-core/src/python/gnuradio/gr/qa_affinity.py new file mode 100644 index 000000000..7b3ca6ed6 --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/gr/qa_affinity.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# Copyright 2013 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +from gnuradio import gr, gr_unittest + +class test_affinity(gr_unittest.TestCase): + + def setUp(self): + self.tb = gr.top_block() + + def tearDown(self): + self.tb = None + + def test_000(self): + # Just run some data through and make sure it doesn't puke. + src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + + src = gr.vector_source_f(src_data) + snk = gr.vector_sink_f() + + src.set_processor_affinity([0,]) + self.tb.connect(src, snk) + self.tb.run() + + a = src.processor_affinity() + + self.assertEqual((0,), a) + +if __name__ == '__main__': + gr_unittest.run(test_affinity, "test_affinity.xml") diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h index 60832675c..10c6c38cc 100644 --- a/gruel/src/include/gruel/thread.h +++ b/gruel/src/include/gruel/thread.h @@ -75,7 +75,7 @@ namespace gruel { * support in this way since 10.5 is not what we want or can use in * this fashion). */ - GRUEL_API void thread_bind_to_processor(const std::vector &mask); + GRUEL_API void thread_bind_to_processor(const std::vector &mask); /*! \brief Convineince function to bind the current thread to a single core. * @@ -87,7 +87,7 @@ namespace gruel { * support in this way since 10.5 is not what we want or can use in * this fashion). */ - GRUEL_API void thread_bind_to_processor(unsigned int n); + GRUEL_API void thread_bind_to_processor(int n); /*! \brief Bind a thread to a set of cores. * @@ -101,7 +101,7 @@ namespace gruel { * support in this way since 10.5 is not what we want or can use in * this fashion). */ - GRUEL_API void thread_bind_to_processor(gr_thread_t thread, const std::vector &mask); + GRUEL_API void thread_bind_to_processor(gr_thread_t thread, const std::vector &mask); /*! \brief Convineince function to bind the a thread to a single core. diff --git a/gruel/src/lib/thread.cc b/gruel/src/lib/thread.cc index 8ebe822fb..a5116b687 100644 --- a/gruel/src/lib/thread.cc +++ b/gruel/src/lib/thread.cc @@ -38,33 +38,33 @@ namespace gruel { } void - thread_bind_to_processor(unsigned int n) + thread_bind_to_processor(int n) { - std::vector mask(1, n); + std::vector mask(1, n); thread_bind_to_processor(get_current_thread_id(), mask); } void - thread_bind_to_processor(const std::vector &mask) + thread_bind_to_processor(const std::vector &mask) { thread_bind_to_processor(get_current_thread_id(), mask); } void - thread_bind_to_processor(gr_thread_t thread, unsigned int n) + thread_bind_to_processor(gr_thread_t thread, int n) { - std::vector mask(1, n); + std::vector mask(1, n); thread_bind_to_processor(thread, mask); } void - thread_bind_to_processor(gr_thread_t thread, const std::vector &mask) + thread_bind_to_processor(gr_thread_t thread, const std::vector &mask) { //DWORD_PTR mask = (1 << n); DWORD_PTR dword_mask = 0; - std::vector _mask = mask; - std::vector::iterator itr; + std::vector _mask = mask; + std::vector::iterator itr; for(itr = _mask.begin(); itr != _mask.end(); itr++) dword_mask |= (1 << (*itr)); @@ -106,25 +106,25 @@ namespace gruel { } void - thread_bind_to_processor(unsigned int n) + thread_bind_to_processor(int n) { // Not implemented on OSX } void - thread_bind_to_processor(gr_thread_t thread, unsigned int n) + thread_bind_to_processor(gr_thread_t thread, int n) { // Not implemented on OSX } void - thread_bind_to_processor(const std::vector &mask) + thread_bind_to_processor(const std::vector &mask) { // Not implemented on OSX } void - thread_bind_to_processor(gr_thread_t thread, const std::vector &mask) + thread_bind_to_processor(gr_thread_t thread, const std::vector &mask) { // Not implemented on OSX } @@ -157,32 +157,32 @@ namespace gruel { } void - thread_bind_to_processor(unsigned int n) + thread_bind_to_processor(int n) { - std::vector mask(1, n); + std::vector mask(1, n); thread_bind_to_processor(get_current_thread_id(), mask); } void - thread_bind_to_processor(const std::vector &mask) + thread_bind_to_processor(const std::vector &mask) { thread_bind_to_processor(get_current_thread_id(), mask); } void - thread_bind_to_processor(gr_thread_t thread, unsigned int n) + thread_bind_to_processor(gr_thread_t thread, int n) { - std::vector mask(1, n); + std::vector mask(1, n); thread_bind_to_processor(thread, mask); } void - thread_bind_to_processor(gr_thread_t thread, const std::vector &mask) + thread_bind_to_processor(gr_thread_t thread, const std::vector &mask) { cpu_set_t set; size_t len = sizeof(cpu_set_t); - std::vector _mask = mask; - std::vector::iterator itr; + std::vector _mask = mask; + std::vector::iterator itr; CPU_ZERO(&set); for(itr = _mask.begin(); itr != _mask.end(); itr++) -- cgit