# Volk development using orc

**URL:** <https://www.ruby-forum.com/t/volk-development-using-orc/222052>\
**Category:** GNU Radio\
**Created:** [August 9, 2012, 11:43pm UTC](https://www.ruby-forum.com/t/volk-development-using-orc/222052 "2012-08-09T23:43: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:** [August 9, 2012, 11:43pm UTC](https://www.ruby-forum.com/t/volk-development-using-orc/222052/1 "2012-08-09T23:43:13Z")

</div>

Hi list,

I am currently trying to wrap my head around volk and have some  
questions concerning orc.

- Is writing an \*.orc file and adding it to the appropriate header under  
volk/include/volk/ everything that has to be done to get an initial volk  
kernel?
- If I am using orc, do I still have to write a general fallback  
function in pure c++?

The reason why I want to write a volk kernel is, that I need to add two  
complex vectors. I was only able to find a volk kernel for float  
vectors. Am I missing something? Adding two complex vectors seems to be  
such a basic and obvious operation, is there some kind of workaround or  
a better alternative?

Thanks a lot,

Gerald

---

<div class="post-metadata">

**Author:** ![gerald\_b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b2d939/32.png) [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Post date:** [August 10, 2012, 1:33am UTC](https://www.ruby-forum.com/t/volk-development-using-orc/222052/2 "2012-08-10T01:33:43Z")

</div>

Just add the complex stream as floats and multiply the length of the  
operation x2.

–n

On Thu, Aug 9, 2012 at 2:42 PM, Gerald B.

---

<div class="post-metadata">

**Author:** ![gerald\_b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b2d939/32.png) [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Post date:** [August 10, 2012, 6:41am UTC](https://www.ruby-forum.com/t/volk-development-using-orc/222052/3 "2012-08-10T06:41:36Z")

</div>

D’oh! Thanks that did the trick. For everyone who is interested, this is  
the snippet of working code:

gr\_complex \*out = (gr\_complex \*) output\_items[0];  
int noi = noutput\_items;  
gr\_complex temp1[noi];  
gr\_complex temp2[noi];  
// do something with temp1 and temp2  
volk\_32f\_x2\_add\_32f\_a((float \*)out, (float \*)temp1, (float _)temp2,  
2_noi);

Best regards,

Gerald
