# How to use VOLK instructions with shorts

**URL:** <https://www.ruby-forum.com/t/how-to-use-volk-instructions-with-shorts/221797>\
**Category:** GNU Radio\
**Created:** [July 31, 2012, 3:01pm UTC](https://www.ruby-forum.com/t/how-to-use-volk-instructions-with-shorts/221797 "2012-07-31T15:01:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 31, 2012, 3:01pm UTC](https://www.ruby-forum.com/t/how-to-use-volk-instructions-with-shorts/221797/1 "2012-07-31T15:01:13Z")

</div>

Dear all,

we are looking into the implementation of correlators in which the two  
sequences to correlate are vectors of std::complex. For  
gr\_complex, we use:

volk\_32fc\_x2\_dot\_prod\_32fc\_a

but for shorts we would need something like  
volk\_16ic\_x2\_dot\_prod\_16ic\_a, which does not exist. What is the best  
way to go? It makes sense to implement such a function, or there is  
not much gain expected with this specific data format?

Any advice will be greatly appreciated!

Best regards,  
Carles

---

<div class="post-metadata">

**Author:** ![Carles\_Fernandez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3e96dc/32.png) [@Carles\_Fernandez](https://www.ruby-forum.com/u/Carles_Fernandez)\
**Post date:** [August 1, 2012, 2:49am UTC](https://www.ruby-forum.com/t/how-to-use-volk-instructions-with-shorts/221797/2 "2012-08-01T02:49:36Z")

</div>

On 07/31/2012 06:00 AM, Carles Fernandez wrote:

> way to go? It makes sense to implement such a function, or there is  
> not much gain expected with this specific data format?

typically the model is to add the kernel to volk, its just another  
header in volk/include/volk/volk\_32fc\_x2\_dot\_prod\_32fc\_a.h

Write the generic (C only) implementation, and use this in your block,  
test it, make sure it works. Then write another implementation using  
SIMD intrinsics.

> Any advice will be greatly appreciated!

gnuradio often focuses on floats and x86. It would be wonderful to see  
some more fixed point contributions. go for it!

As far as performance, it depends on your CPU. For arm, fixed point  
computation could be beneficial. For x86, floating point is already  
pretty optimized, so less of a performance gain I assume.

-josh

PS dont listen to me, let the benchmarking decide what performs best 🙂

---

<div class="post-metadata">

**Author:** ![Carles\_Fernandez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3e96dc/32.png) [@Carles\_Fernandez](https://www.ruby-forum.com/u/Carles_Fernandez)\
**Post date:** [August 1, 2012, 10:29am UTC](https://www.ruby-forum.com/t/how-to-use-volk-instructions-with-shorts/221797/3 "2012-08-01T10:29:31Z")

</div>

On Tue, Jul 31, 2012 at 05:48:50PM -0700, Josh B. wrote:

> As far as performance, it depends on your CPU. For arm, fixed point  
> computation could be beneficial. For x86, floating point is already  
> pretty optimized, so less of a performance gain I assume.
> 
> -josh
> 
> PS dont listen to me, let the benchmarking decide what performs best 🙂

In general, I’d encourage the reader of discuss-gnuradio to listen to  
Josh, though.

MB

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.  
Research Associate

Kaiserstraße 12  
Building 05.01  
76131 Karlsruhe

Phone: +49 721 608-43790  
Fax: +49 721 608-46071  
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and  
National Laboratory of the Helmholtz Association
