diff options
author | Josh Blum | 2013-04-15 01:49:12 -0700 |
---|---|---|
committer | Josh Blum | 2013-04-15 01:49:12 -0700 |
commit | ae55a6d41af61415a56f43b087ccba2f43409fad (patch) | |
tree | aee51e204275d2272a206acdbda2af5ea06f4119 /gnuradio-core/src/lib/runtime/gr_block.h | |
parent | 563240c2b4efc26e6c4032b0d3d75fc5489b7f1f (diff) | |
download | gnuradio-ae55a6d41af61415a56f43b087ccba2f43409fad.tar.gz gnuradio-ae55a6d41af61415a56f43b087ccba2f43409fad.tar.bz2 gnuradio-ae55a6d41af61415a56f43b087ccba2f43409fad.zip |
gras: inline a bunch of wrapper calls
Also simplify the work by reusing
work buffers mins already calculated
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_block.h')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_block.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h index c3898a5c0..44faa313a 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.h +++ b/gnuradio-core/src/lib/runtime/gr_block.h @@ -388,4 +388,50 @@ struct GR_CORE_API gr_block : gras::Block typedef boost::shared_ptr<gr_block> gr_block_sptr; +GRAS_FORCE_INLINE void gr_block::consume_each(const int how_many_items) +{ + if GRAS_UNLIKELY(how_many_items < 0) return; + gras::Block::consume(size_t(how_many_items)); +} + +GRAS_FORCE_INLINE void gr_block::consume(const size_t i, const int how_many_items) +{ + if GRAS_UNLIKELY(how_many_items < 0) return; + gras::Block::consume(i, size_t(how_many_items)); +} + +GRAS_FORCE_INLINE void gr_block::produce(const size_t o, const int how_many_items) +{ + if GRAS_UNLIKELY(how_many_items < 0) return; + gras::Block::produce(o, size_t(how_many_items)); +} + +GRAS_FORCE_INLINE uint64_t gr_block::nitems_read(const size_t which_input) +{ + return Block::get_consumed(which_input); +} + +GRAS_FORCE_INLINE uint64_t gr_block::nitems_written(const size_t which_output) +{ + return Block::get_produced(which_output); +} + +GRAS_FORCE_INLINE size_t gr_block::interpolation(void) const +{ + return _interp; +} + +GRAS_FORCE_INLINE size_t gr_block::decimation(void) const +{ + return _decim; +} + +GRAS_FORCE_INLINE bool gr_block::is_unaligned(void) +{ + //TODO + //probably dont need this since volk dispatcher checks alignment + //32 byte aligned is good enough for you + return (_work_io_ptr_mask & ptrdiff_t(GRAS_MAX_ALIGNMENT-1)) != 0; +} + #endif /*INCLUDED_GNURADIO_GR_BLOCK_H*/ |