# Re: Which blocks do you like?

**URL:** <https://www.ruby-forum.com/t/re-which-blocks-do-you-like/241978>\
**Category:** GNU Radio\
**Created:** [May 18, 2015, 12:42pm UTC](https://www.ruby-forum.com/t/re-which-blocks-do-you-like/241978 "2015-05-18T12:42:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 18, 2015, 12:42pm UTC](https://www.ruby-forum.com/t/re-which-blocks-do-you-like/241978/1 "2015-05-18T12:42:59Z")

</div>

For the bug, wouldn’t be sufficient to substiture the above code

// Find the magnitude squared of the correlation  
std::vector corr\_mag(noutput\_items);  
volk\_32fc\_magnitude\_squared\_32f(&corr\_mag[0], corr,  
noutput\_items);

with:

```
  std::vector<float> corr_mag(noutput_items+1);
  volk_32fc_magnitude_squared_32f(&corr_mag[0], corr, 

```

noutput\_items);  
corr\_mag[noutput\_items]=-1;  
In theory the vector cannot contain negative value.

Actually I’m not usign sync\_block,but only the generick gr::block…I try  
to  
explain how I am currently managing memory:  
between each couple of attached block,where is a circular buffer(e.g. 32  
position if we don’t have problems with latency),where each element is a  
device memory page(e.g. with 4096 elements).  
At the beginning,for each link the bottom block send his preference  
about  
memory(e.g. min/max size,history page,mandatory divisor for each  
page[mandatory for FFT],other stuff)…the upon block will take decision  
about memory,sending down its choices. (for multiple input blocks  
attached  
to same output things would be similar)  
So it is possible that for a “synch\_block” the number of input page is  
different to n° output page.  
Usually CUDA blocks send only one item each time to following block in  
order to wake up.(data are passed throught device memory and others)

The final return and consume\_each() are done according if all elements  
in  
CUDA buffer were consumed or not,and if there are new items in output
