diff options
author | David Sorber <david.sorber@blacklynx.tech> | 2021-05-12 08:59:21 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-10-25 11:27:01 -0400 |
commit | 788827ae116bef871e144abd39b1e4482208eabe (patch) | |
tree | dcfee04a77db5bb3c8042be5b0b95c54bf8759c9 /gnuradio-runtime/lib/qa_buffer.cc | |
parent | b8713810a2d07ac1a632bd7bfb23f3f48f67e222 (diff) |
runtime: Custom Buffer/Accelerator Device Support - Milestone 1
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>
Diffstat (limited to 'gnuradio-runtime/lib/qa_buffer.cc')
-rw-r--r-- | gnuradio-runtime/lib/qa_buffer.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gnuradio-runtime/lib/qa_buffer.cc b/gnuradio-runtime/lib/qa_buffer.cc index c0e9c0d130..cefe548338 100644 --- a/gnuradio-runtime/lib/qa_buffer.cc +++ b/gnuradio-runtime/lib/qa_buffer.cc @@ -14,6 +14,8 @@ #include <gnuradio/buffer.h> +#include <gnuradio/buffer_double_mapped.h> +#include <gnuradio/buffer_reader.h> #include <gnuradio/random.h> #include <boost/test/unit_test.hpp> #include <cstdlib> @@ -40,7 +42,8 @@ static void t0_body() int nitems = 4000 / sizeof(int); int counter = 0; - gr::buffer_sptr buf(gr::make_buffer(nitems, sizeof(int), gr::block_sptr())); + gr::buffer_sptr buf( + gr::make_buffer_double_mapped(nitems, sizeof(int), nitems, gr::block_sptr())); int last_sa; int sa; @@ -74,7 +77,8 @@ static void t1_body() int write_counter = 0; int read_counter = 0; - gr::buffer_sptr buf(gr::make_buffer(nitems, sizeof(int), gr::block_sptr())); + gr::buffer_sptr buf( + gr::make_buffer_double_mapped(nitems, sizeof(int), nitems, gr::block_sptr())); gr::buffer_reader_sptr r1(gr::buffer_add_reader(buf, 0, gr::block_sptr())); int sa; @@ -145,7 +149,8 @@ static void t2_body() int nitems = (64 * (1L << 10)) / sizeof(int); // 64K worth of ints - gr::buffer_sptr buf(gr::make_buffer(nitems, sizeof(int), gr::block_sptr())); + gr::buffer_sptr buf( + gr::make_buffer_double_mapped(nitems, sizeof(int), nitems, gr::block_sptr())); gr::buffer_reader_sptr r1(gr::buffer_add_reader(buf, 0, gr::block_sptr())); int read_counter = 0; @@ -210,7 +215,8 @@ static void t3_body() int nitems = (64 * (1L << 10)) / sizeof(int); static const int N = 5; - gr::buffer_sptr buf(gr::make_buffer(nitems, sizeof(int), gr::block_sptr())); + gr::buffer_sptr buf( + gr::make_buffer_double_mapped(nitems, sizeof(int), nitems, gr::block_sptr())); gr::buffer_reader_sptr reader[N]; int read_counter[N]; int write_counter = 0; |