# Curiosity about implementation of block with multiple data type

**URL:** <https://www.ruby-forum.com/t/curiosity-about-implementation-of-block-with-multiple-data-type/241789>\
**Category:** GNU Radio\
**Created:** [April 30, 2015, 3:31pm UTC](https://www.ruby-forum.com/t/curiosity-about-implementation-of-block-with-multiple-data-type/241789 "2015-04-30T15:31:47Z")\
**Posts on this page:** 3\
**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:** [April 30, 2015, 3:31pm UTC](https://www.ruby-forum.com/t/curiosity-about-implementation-of-block-with-multiple-data-type/241789/1 "2015-04-30T15:31:47Z")

</div>

Looking better about implementation of blocks like fft,fir,etc a  
question  
rise in my brain.  
Why in blocks with selectable input/output data type there are C++  
multiple  
file, each one with the specialization of a single data type(file  
finishing  
with \_cc,\_ff,etc), instead of use template(and eventually explicit  
specialization where is necessary)?

I’m not an expert,so I’d like to understand why you have chosen an  
approach  
instead of another.

Thanks,  
marco

---

<div class="post-metadata">

**Author:** ![marco\_Ribero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@marco\_Ribero](https://www.ruby-forum.com/u/marco_Ribero)\
**Post date:** [April 30, 2015, 4:48pm UTC](https://www.ruby-forum.com/t/curiosity-about-implementation-of-block-with-multiple-data-type/241789/2 "2015-04-30T16:48:54Z")

</div>

On Thu, Apr 30, 2015 at 9:30 AM, marco Ribero  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thanks,  
> marco

We don’t use templates because we do a lot of low-level math, especially  
with the use of VOLK, that’s very type-specific. You couldn’t call  
volk\_32fc\_x2\_dot\_prod\_32fc in a templated FIR filter class without  
specializing the template for complex inputs and taps. By the time we’re  
done, we’ve ended up specializing every data type so there’s no point in  
using templates at all.

Now pre-VOLK, the reason was because SWIG was terrible about supporting  
templated classes and functions, so Eric invented his own version. But  
because we’re more worried about speed, we’ve not bother to re-architect  
things with templates with the expectation that we’d just be  
specializing  
everything, anyways.

Tom

---

<div class="post-metadata">

**Author:** ![marco\_Ribero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@marco\_Ribero](https://www.ruby-forum.com/u/marco_Ribero)\
**Post date:** [April 30, 2015, 5:14pm UTC](https://www.ruby-forum.com/t/curiosity-about-implementation-of-block-with-multiple-data-type/241789/3 "2015-04-30T17:14:37Z")

</div>

Ok I’ve understood. Thank you for your answer.

Have a good day,  
Marco

Il giorno gio 30 apr 2015 16:47 Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ha  
scritto:
