Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Martin Braun
On 03/20/2014 07:16 PM, Nasi wrote:
> I've got this error:
> 
> 
> /tmp/ccE79VRG.o: In function `main':
> 
> t2_rx_ompalg.cc:(.text+0x6a5): undefined reference to
> `volk_32fc_x2_dot_prod_32fc'
> collect2: error: ld returned 1 exit status
> 
> I was running it inside main function as
> 
> g++ -std=c++11 t2_rx_ompalg.cc -o t2_rx_ompalg -lm -lfftw3

You need to link to VOLK, too.

M


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Nasi
 I've got this error:

/tmp/ccE79VRG.o: In function `main':
t2_rx_ompalg.cc:(.text+0x6a5): undefined reference to 
`volk_32fc_x2_dot_prod_32fc'
collect2: error: ld returned 1 exit status I was running it inside main 
function as
g++ -std=c++11 t2_rx_ompalg.cc -o t2_rx_ompalg -lm -lfftw3
 
Do you know what is it for?

-
NE


Thu, 20 Mar 2014 13:04:02 -0400 от Tom Rondeau :
>On Thu, Mar 20, 2014 at 12:51 PM, Nasi < nesaz...@mail.ru > wrote:
>> Thanks!
>>
>> As I see you apply it to the first element of x as in
>> volk_32fc_something_32fc(&x[0], ...);.
>> I want to multiply the whole vector like as a inner product of two vectors.
>> Is it possible?
>>
>> -
>> NE
>
>Not sure I exactly follow your comment, but you can do something like this:
>
>int N;
>vector x(N);
>vector y(N);
>vector z(N);
>
>// fill x and y with stuff
>
>volk_32fc_x2_dot_prod_32fc(&z[0], &x[0], &y[0], N);
>
>That will take the dot product of x and y and put the results in z.
>
>Tom
>
>
>> Четверг, 20 марта 2014, 10:28 -04:00 от Tom Rondeau < t...@trondeau.com >:
>>
>> On Thu, Mar 20, 2014 at 10:09 AM, Aditya Dhananjay < adi...@cs.nyu.edu >
>> wrote:
>>> I had the same question. Thanks! :)
>>
>> One thing that I forgot to mention is that VOLK is written purely in
>> C, so C++ vectors as-is won't work. You need to index them, but
>> luckily, std::vector's are guaranteed to be contiguous in memory when
>> indexed.
>>
>> In other words:
>>
>> std::vector x;
>> volk_32fc_something_32fc(&x[0], ...);
>>
>> Tom
>>
>>
>>
>>> On Thu, Mar 20, 2014 at 10:07 AM, Tom Rondeau < t...@trondeau.com > wrote:

 On Thu, Mar 20, 2014 at 7:05 AM, Nasi < nesaz...@mail.ru > wrote:
 > Hi all,
 >
 > I am using ubuntu 13.04, GNUradio 3.7.
 > I have a question related to VOLK library.
 >
 > When I create a vector, lets say:
 >
 > vector y1;
 >
 > Can I multiply this vector to another vector using VOLK?
 > Is there any good documentation for this?
 >
 > --
 > NE

 Myself and Nick McCarthy have published and presented on VOLK. Here's
 a pretty good overview video of using it:
  http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html

 To answer your question, yes, building a vector like that is
 acceptable for use with volk kernels as long as you are using the
 correct data types. Be aware of alignment requirements, though, which
 the link above explains.

 Tom

 ___
 Discuss-gnuradio mailing list
  Discuss-gnuradio@gnu.org
  https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

>>>
>>
>>
>>
>> --
>> NE


-- 
NE
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Tom Rondeau
On Thu, Mar 20, 2014 at 12:51 PM, Nasi  wrote:
> Thanks!
>
> As I see you apply it to the first element of x as in
> volk_32fc_something_32fc(&x[0], ...);.
> I want to multiply the whole vector like as a inner product of two vectors.
> Is it possible?
>
> -
> NE

Not sure I exactly follow your comment, but you can do something like this:

int N;
vector x(N);
vector y(N);
vector z(N);

// fill x and y with stuff

volk_32fc_x2_dot_prod_32fc(&z[0], &x[0], &y[0], N);

That will take the dot product of x and y and put the results in z.

Tom


> Четверг, 20 марта 2014, 10:28 -04:00 от Tom Rondeau :
>
> On Thu, Mar 20, 2014 at 10:09 AM, Aditya Dhananjay 
> wrote:
>> I had the same question. Thanks! :)
>
> One thing that I forgot to mention is that VOLK is written purely in
> C, so C++ vectors as-is won't work. You need to index them, but
> luckily, std::vector's are guaranteed to be contiguous in memory when
> indexed.
>
> In other words:
>
> std::vector x;
> volk_32fc_something_32fc(&x[0], ...);
>
> Tom
>
>
>
>> On Thu, Mar 20, 2014 at 10:07 AM, Tom Rondeau  wrote:
>>>
>>> On Thu, Mar 20, 2014 at 7:05 AM, Nasi  wrote:
>>> > Hi all,
>>> >
>>> > I am using ubuntu 13.04, GNUradio 3.7.
>>> > I have a question related to VOLK library.
>>> >
>>> > When I create a vector, lets say:
>>> >
>>> > vector y1;
>>> >
>>> > Can I multiply this vector to another vector using VOLK?
>>> > Is there any good documentation for this?
>>> >
>>> > --
>>> > NE
>>>
>>> Myself and Nick McCarthy have published and presented on VOLK. Here's
>>> a pretty good overview video of using it:
>>> http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html
>>>
>>> To answer your question, yes, building a vector like that is
>>> acceptable for use with volk kernels as long as you are using the
>>> correct data types. Be aware of alignment requirements, though, which
>>> the link above explains.
>>>
>>> Tom
>>>
>>> ___
>>> Discuss-gnuradio mailing list
>>> Discuss-gnuradio@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>
>
>
>
> --
> NE

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Nasi
 Thanks!

As I see you apply it to the first element of x as in 
volk_32fc_something_32fc(&x[0], ...);.
I want to multiply the whole vector like as a inner product of two vectors. Is 
it possible?

-
NE


Четверг, 20 марта 2014, 10:28 -04:00 от Tom Rondeau :
>On Thu, Mar 20, 2014 at 10:09 AM, Aditya Dhananjay < adi...@cs.nyu.edu > wrote:
>> I had the same question. Thanks! :)
>
>One thing that I forgot to mention is that VOLK is written purely in
>C, so C++ vectors as-is won't work. You need to index them, but
>luckily, std::vector's are guaranteed to be contiguous in memory when
>indexed.
>
>In other words:
>
>std::vector x;
>volk_32fc_something_32fc(&x[0], ...);
>
>Tom
>
>
>
>> On Thu, Mar 20, 2014 at 10:07 AM, Tom Rondeau < t...@trondeau.com > wrote:
>>>
>>> On Thu, Mar 20, 2014 at 7:05 AM, Nasi < nesaz...@mail.ru > wrote:
>>> > Hi all,
>>> >
>>> > I am using ubuntu 13.04, GNUradio 3.7.
>>> > I have a question related to VOLK library.
>>> >
>>> > When I create a vector, lets say:
>>> >
>>> > vector y1;
>>> >
>>> > Can I multiply this vector to another vector using VOLK?
>>> > Is there any good documentation for this?
>>> >
>>> > --
>>> > NE
>>>
>>> Myself and Nick McCarthy have published and presented on VOLK. Here's
>>> a pretty good overview video of using it:
>>>  http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html
>>>
>>> To answer your question, yes, building a vector like that is
>>> acceptable for use with volk kernels as long as you are using the
>>> correct data types. Be aware of alignment requirements, though, which
>>> the link above explains.
>>>
>>> Tom
>>>
>>> ___
>>> Discuss-gnuradio mailing list
>>>  Discuss-gnuradio@gnu.org
>>>  https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>


-- 
NE
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Tom Rondeau
On Thu, Mar 20, 2014 at 10:09 AM, Aditya Dhananjay  wrote:
> I had the same question. Thanks! :)

One thing that I forgot to mention is that VOLK is written purely in
C, so C++ vectors as-is won't work. You need to index them, but
luckily, std::vector's are guaranteed to be contiguous in memory when
indexed.

In other words:

std::vector x;
volk_32fc_something_32fc(&x[0], ...);

Tom



> On Thu, Mar 20, 2014 at 10:07 AM, Tom Rondeau  wrote:
>>
>> On Thu, Mar 20, 2014 at 7:05 AM, Nasi  wrote:
>> > Hi all,
>> >
>> > I am using ubuntu 13.04, GNUradio 3.7.
>> > I have a question related to VOLK library.
>> >
>> > When I create a vector, lets say:
>> >
>> > vector y1;
>> >
>> > Can I multiply this vector to another vector using VOLK?
>> > Is there any good documentation for this?
>> >
>> > --
>> > NE
>>
>> Myself and Nick McCarthy have published and presented on VOLK. Here's
>> a pretty good overview video of using it:
>> http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html
>>
>> To answer your question, yes, building a vector like that is
>> acceptable for use with volk kernels as long as you are using the
>> correct data types. Be aware of alignment requirements, though, which
>> the link above explains.
>>
>> Tom
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Aditya Dhananjay
I had the same question. Thanks! :)


On Thu, Mar 20, 2014 at 10:07 AM, Tom Rondeau  wrote:

> On Thu, Mar 20, 2014 at 7:05 AM, Nasi  wrote:
> > Hi all,
> >
> > I am using ubuntu 13.04, GNUradio 3.7.
> > I have a question related to VOLK library.
> >
> > When I create a vector, lets say:
> >
> > vector y1;
> >
> > Can I multiply this vector to another vector using VOLK?
> > Is there any good documentation for this?
> >
> > --
> > NE
>
> Myself and Nick McCarthy have published and presented on VOLK. Here's
> a pretty good overview video of using it:
> http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html
>
> To answer your question, yes, building a vector like that is
> acceptable for use with volk kernels as long as you are using the
> correct data types. Be aware of alignment requirements, though, which
> the link above explains.
>
> Tom
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] VOLK - vector multiplication

2014-03-20 Thread Tom Rondeau
On Thu, Mar 20, 2014 at 7:05 AM, Nasi  wrote:
> Hi all,
>
> I am using ubuntu 13.04, GNUradio 3.7.
> I have a question related to VOLK library.
>
> When I create a vector, lets say:
>
> vector y1;
>
> Can I multiply this vector to another vector using VOLK?
> Is there any good documentation for this?
>
> --
> NE

Myself and Nick McCarthy have published and presented on VOLK. Here's
a pretty good overview video of using it:
http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html

To answer your question, yes, building a vector like that is
acceptable for use with volk kernels as long as you are using the
correct data types. Be aware of alignment requirements, though, which
the link above explains.

Tom

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio