summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/buffer.cc
Commit message (Collapse)AuthorAgeFilesLines
* runtime: rename buffer_context to transfer type; also rename theDavid Sorber2021-10-251-8/+10
| | | | | | | | MAKE_CUSTOM_BUFFER_TYPE macro function to DEFINE_CUSTOM_BUFFER_TYPE; mark unused parameters from virtual functions with the [[maybe_unused]] C++ attribute Signed-off-by: David Sorber <david.sorber@blacklynx.tech>
* runtime: Custom Buffer/Accelerator Device Support - Milestone 2David Sorber2021-10-251-32/+39
| | | | | | | | | | | | | | | | | Completion of custom buffer/accelerator device support changes: * Improved custom buffer interface by removing awkward memory allocation functions from the block class * Increased flexibility for creating custom buffers by allowing creation of buffer_single_mapped subclasses * Fully incorporated data movement abstraction into the custom buffer interface and the runtime itself; accelerated blocks are no longer directly responsible for their own data movement * Zero copy back-to-back accelerated blocks are now supported (data no longer needs to be moved back to the host between each block) Signed-off-by: David Sorber <david.sorber@blacklynx.tech> Signed-off-by: Mike Mason <mike.mason@blacklynx.tech>
* runtime: Custom Buffer/Accelerator Device Support - Milestone 1David Sorber2021-10-251-179/+94
| | | | | | | | | | | | | | | Custom Buffer/Accelerator Device Support - Milestone 1 changes: * Refactored existing single mapped buffer code and created single mapped buffer abstraction; wrapping within single mapped buffers is handled explicitly by input blocked and output blocked callbacks that are called from block_executor * Added simple custom buffer allocation interface (NOTE: this interface will change for milestone 2) * Accelerated blocks are still responsible for data transfer but the custom buffer interface eliminates the double copy problem Signed-off-by: David Sorber <david.sorber@blacklynx.tech>
* runtime: include boost/format where usedMarcus Müller2021-09-071-0/+1
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* global: remove iostream from all files not use cout|cerr|cin|clogMarcus Müller2021-06-171-1/+0
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* clang-tidy: run full .clang-tidy on C++17 codebaseMarcus Müller2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | run /usr/share/clang/run-clang-tidy.py -checks=file '-header-filter=.*' -fix .. from build directory. Then, clang-format -i $(git diff --name-only origin/master) to clang-format changed files. Then, refresh all header hashes in pybind bindings (*/python/bindings/*.cc) Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* runtime: replace stderr logging by calls to GR's logging faciltiesMarcus Müller2020-04-131-10/+14
|
* boost: remove deprecated math/common_factor.hppjapm482020-04-111-16/+3
| | | | | Remove deprecation warning and prefer using std::{lcm,gcd} to Boost. Fixes #2712.
* runtime: Remove most manual memory managementThomas Habets2020-04-111-3/+1
| | | | | | The remaining ones: * `pmt_pool.cc`, which is a memory allocator so that makes sense * the tricky and aptly named `sptr_magic.cc`.
* Switch from boost pointers to std C++11 pointersThomas Habets2020-04-011-1/+1
| | | | | | | | | | | | | | | | | | | Most of this code is automated code changes: ``` set -e SUB="s/dummy/dummy/" for i in shared_ptr make_shared dynamic_pointer_cast weak_ptr enable_shared_from_this get_deleter; do SUB="$SUB;s/boost::$i/std::$i/g" done SUB="$SUB;s^#include <boost/shared_ptr.hpp>^#include <memory>^g" SUB="$SUB;s^namespace boost^namespace std^g" find . \( -name "*.cc" -o -name "*.h" -o -name "*.i" -o -name "*.cxx" -o -name "*.py" \) -print0 | xargs -0 sed -i "$SUB" ``` Only one manual change. In `./gr-fec/lib/fec_mtrx_impl.cc`, add `#include <algorithm>`.
* Update license header to SPDX formatdevnulling2020-01-271-13/+1
|
* Fix all formatting issuesMartin Braun2020-01-101-2/+2
| | | | | This fixes every leftover file in the GNU Radio source tree to match our clang-format definition.
* runtime: Fix premature tag pruning from buffer with sample delay.Ryan Volz2020-01-071-2/+0
| | | | | | | | | | | The buffer object keeps track of the max reader delay (d_max_reader_delay) so that it won't prune tags until after the delay has passed. However, the d_max_reader_delay value was being set to 0 with every buffer_reader instantiation for a given buffer, essentially ignoring delays that are set for prior readers. This patch removes the spurious setting of d_max_reader_delay to 0 whenever a new buffer_reader is instantiated.
* runtime: Fix get_tags_in_range for (end - start) > delay.Ryan Volz2020-01-071-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, stream tags would be lost (not propagated downstream) when a block has a tag delay set and it is called with a number of input samples that is less than the delay. Since this happens depending on the scheduler and the number of samples provided, tags might mostly work or seemingly randomly disappear. The problem occurs because a wrong correction is included for underflows in unsigned arithmetic that limits the tags propagated to a smaller sample window than desired. Correctly detecting the underflow and setting the value to 0 rather than abs_start or abs_end fixes the problem. For a real example, let the d_attr_delay=209, abs_start=0, and abs_end=200 with a tag at input sample 0. Then tags from min(abs_start, abs_start - d_attr_delay) == 0 to min(abs_end, abs_end - d_attr_delay) == 200 are iterated through, including the tag at 0 (item_time == 209), but it is not propagated to the output yet since item_time >= abs_end (209 >= 200). On the next call to the block, with abs_start=200 and abs_end=400, the tag at input sample 0 is ignored because min(abs_start, abs_start - d_attr_delay) == 200 and the iterator skips it. The correct calculation for the lower bound of the tag iterator would result in 0 and find the tag since (abs_start - d_attr_delay) == -9 -> 0 when constrained to unsigned values. With the proper lower bound (and upper bound corrected as well), the tag at 0 is found with an item_time == 209 which falls between abs_start and abs_end and is propagated to output sample 209.
* clang-format: Ordering all the includesMarcus Müller2019-08-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang-format: ordering includes in gnuradio-runtime clang-format: ordering includes in gr-filter clang-format: ordering includes in gr-fft clang-format: ordering includes in gr-audio clang-format: ordering includes in gr-analog clang-format: ordering includes in gr-fec clang-format: ordering includes in gr-wavelet clang-format: ordering includes in gr-zeromq clang-format: ordering includes in gr-vocoder clang-format: ordering includes in gr-video-sdl clang-format: ordering includes in gr-trellis clang-format: ordering includes in gr-blocks clang-format: ordering includes in gr-digital clang-format: ordering includes in gr-uhd clang-format: ordering includes in gr-dtv clang-format: ordering includes in gr-channels clang-format: ordering includes in gr-qtgui clang_format.py: re-enable include reordering
* Tree: clang-format without the include sortingMarcus Müller2019-08-091-239/+220
|
* runtime: fix use of boost::math::gcd and boost::integer::gcdMichael Dickens2018-11-161-0/+13
| | | | | | | + the former was augmented by the latter in Boost 1.58.0; + they do the same computation; + the former is being deprecated as of Boost 1.66.0, and recommends moving to the latter; + GR supports Boost 1.54.0 and newer, so we need to be able to support both APIs for now.
* fix: fixed a performance bug in buffer::get_tags_in_range.Brandon P. Enochs2017-07-141-1/+1
| | | | buffer::get_tags_in_range called v.resize(0) instead of v.clear() to clear out the input vector. This causes needless memory allocation of the default value for the second argument to resize. In applications that make heavy use of tags, this can cause significant performance problems as get_tags_in_range performs an extra allocation and deallocation.
* Fixed delayed tag propagationDaulPavid2015-12-271-2/+2
|
* runtime: fixes a problem with tag pruning.Tom Rondeau2015-08-051-6/+31
| | | | | | | | | | | Looked like a race condition if two blocks are reading from the same buffer; one block calls prune before the other one can, and then it no longer gets its tags. This puts back in the original protections we used when pruning with vectors, only we don't have to restart the iterator at the beginning and can exit sooner because of the sort order. Likely slower than the multimap erase, so we will have to reinvestigate what kind of performance hit we take and if we can do better.
* CID 1240027: runtime: clean up tag pruning using iter rangeTim O'Shea2014-09-241-4/+1
|
* Formatting fix-upsDoug Geiger2014-09-191-12/+8
|
* runtime: speed up all the thingsTim O'Shea2014-09-191-4/+4
|
* Fix prune_tagsDoug Geiger2014-09-191-4/+5
|
* Fix(?) prune_tags: needs verificationDoug Geiger2014-09-191-35/+6
|
* tags_wipTim O'Shea2014-09-191-15/+32
|
* runtime: Minor cosmetic typo and whitespace corrections.Moritz Fischer2013-12-071-4/+4
| | | | Signed-off-by: Moritz Fischer <moritz@ettus.com>
* runtime: changed name from set_group_delay to declare_sample_delay.Tom Rondeau2013-11-011-10/+10
|
* runtime: add concept up an automatic update_rate to gr::block.Tom Rondeau2013-10-291-7/+1
| | | | | | When enabled, uses nitems_written/nitems_read to update the relative_rate of a block. Useful for blocks that change their relative rate based on activity in the work function. Disabled by default. digital: PFB clock sync blocks set update_rate to True.
* runtime: for blocks with a group delay, tag location should be moved ↵Tom Rondeau2013-10-291-8/+36
| | | | | | according to the delay. Since group delay is often unknown, we have added a new function set_group_delay to allow the user to set the value once delay is calculated. Also added ability to set the tag propagation delay, which is required for how the blocks::delay works.
* Merge branch 'next' into runtime_pimplJohnathan Corgan2013-05-121-6/+11
| | | | | | | | | | | | | | | | | | Catches up runtime_pimpl branch with changes on next since the initial branch start. Conflicts: gnuradio-runtime/include/gnuradio/constants.h gnuradio-runtime/include/gnuradio/tags.h gnuradio-runtime/include/gr_block_detail.h gnuradio-runtime/include/gr_buffer.h gnuradio-runtime/lib/CMakeLists.txt gnuradio-runtime/lib/gr_block.cc gnuradio-runtime/lib/gr_block_detail.cc gnuradio-runtime/lib/gr_block_executor.cc gnuradio-runtime/lib/gr_buffer.cc gnuradio-runtime/lib/gr_realtime.cc gr-blocks/lib/interleaved_short_to_complex_impl.cc
* runtime: converting runtime core to gr namespace, gnuradio include dir.Tom Rondeau2013-04-291-0/+343