From 788827ae116bef871e144abd39b1e4482208eabe Mon Sep 17 00:00:00 2001 From: David Sorber <david.sorber@blacklynx.tech> Date: Wed, 12 May 2021 08:59:21 -0400 Subject: 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> --- gnuradio-runtime/python/gnuradio/gr_unittest.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gnuradio-runtime/python/gnuradio/gr_unittest.py') diff --git a/gnuradio-runtime/python/gnuradio/gr_unittest.py b/gnuradio-runtime/python/gnuradio/gr_unittest.py index 6177f0f32f..ebd47019a5 100644 --- a/gnuradio-runtime/python/gnuradio/gr_unittest.py +++ b/gnuradio-runtime/python/gnuradio/gr_unittest.py @@ -110,6 +110,25 @@ class TestCase(unittest.TestCase): self.assertComplexAlmostEqual2(x, y, abs_eps, rel_eps, msg) for (x, y) in zip(a, b) ]) + + + def assertSequenceEqualGR(self, data_in, data_out): + """ + Note this function exists because of this bug: https://bugs.python.org/issue19217 + Calling self.assertEqual(seqA, seqB) can hang if seqA and seqB are not equal. + """ + if len(data_in) != len(data_out): + print('Lengths do not match: {:d} -- {:d}'.format(len(data_in), len(data_out))) + self.assertTrue(len(data_in) == len(data_out)) + total_miscompares = 0 + for idx, item in enumerate(zip(data_in, data_out)): + if item[0] != item[1]: + total_miscompares += 1 + print('Miscompare at: {:d} ({:d} -- {:d})'.format(idx, item[0], item[1])) + if total_miscompares > 0: + print('Total miscompares: {:d}'.format(total_miscompares)) + self.assertTrue(total_miscompares == 0) + def waitFor( self, -- cgit v1.2.3