diff options
author | Josh Blum | 2012-08-31 18:41:23 -0700 |
---|---|---|
committer | Josh Blum | 2012-08-31 18:41:23 -0700 |
commit | f5284acf1321558e9409c9cae60045c14d5a52dd (patch) | |
tree | 386efc5fc72d676a2f50fe15ca81d88ca71213b3 /lib | |
parent | ce4dfa1aad38cc2f4336e754d8feb3b245da5c3f (diff) | |
download | sandhi-f5284acf1321558e9409c9cae60045c14d5a52dd.tar.gz sandhi-f5284acf1321558e9409c9cae60045c14d5a52dd.tar.bz2 sandhi-f5284acf1321558e9409c9cae60045c14d5a52dd.zip |
inspired to handle the is_unaligned routine
Diffstat (limited to 'lib')
-rw-r--r-- | lib/block_task.cpp | 3 | ||||
-rw-r--r-- | lib/element_impl.hpp | 1 | ||||
-rw-r--r-- | lib/gr_block.cpp | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp index 6fb9c54..e3efb91 100644 --- a/lib/block_task.cpp +++ b/lib/block_task.cpp @@ -73,6 +73,7 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) const size_t num_inputs = task_iface.get_num_inputs(); const size_t num_outputs = task_iface.get_num_outputs(); //const bool is_source = (num_inputs == 0); + this->work_io_ptr_mask = 0; //reset //------------------------------------------------------------------ //-- sort the input tags before working @@ -104,6 +105,7 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) ASSERT(this->input_buff_offsets[i] < buff.get_length()); + this->work_io_ptr_mask |= ptrdiff_t(mem); this->input_items[i]._mem = mem; this->input_items[i]._len = items; this->work_input_items[i] = mem; @@ -127,6 +129,7 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) const size_t bytes = buff.get_length(); const size_t items = bytes/this->output_items_sizes[i]; + this->work_io_ptr_mask |= ptrdiff_t(mem); this->output_items[i]._mem = mem; this->output_items[i]._len = items; this->work_output_items[i] = mem; diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp index 2ad190a..4742993 100644 --- a/lib/element_impl.hpp +++ b/lib/element_impl.hpp @@ -76,6 +76,7 @@ struct ElementImpl //work buffers for the new work interface Block::InputItems input_items; Block::OutputItems output_items; + ptrdiff_t work_io_ptr_mask; //track work's calls to produce and consume std::vector<size_t> produce_items; diff --git a/lib/gr_block.cpp b/lib/gr_block.cpp index 5d3e2a9..61ac6c6 100644 --- a/lib/gr_block.cpp +++ b/lib/gr_block.cpp @@ -46,14 +46,19 @@ int gr_block::Work( ); } -void gr_block::set_alignment(const size_t alignment) +void gr_block::set_alignment(const size_t) { //TODO + //probably dont need this since buffers always start aligned + //and therefore alignment is always re-acheived } 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 ((*this)->work_io_ptr_mask & ptrdiff_t(0x1f)) != 0; } size_t gr_block::fixed_rate_noutput_to_ninput(const size_t noutput_items) |