Re: [Discuss-gnuradio] how to test sse2 support using cmake

2012-09-20 Thread Josh Blum


On 09/20/2012 09:37 AM, Kyle Zhou wrote:
> Thanks Nick. Yes, I would like to migrate to volk and avoid all the
> hassles. Need to take some time to learn volk first. Can I assume
> volk can perform most of the intrinsics of sse2? Regards KZ On


Checkout the next branch (which has the latest in volk work)

create volk/kernels/volk/volk_my_kern.h

#ifdef LV_HAVE_GENERIC

volk_my_kern_generic(params)
{
//generic c implementation
}

#endif

#ifdef LV_HAVE_SSE2

#include 

//the _a means that this kernel requires aligned pointers
//otherwise use _u if it does not

volk_my_kern_sse2_a(params)
{
//call sse intrinsics here
}

#endif

--

Now just re-run cmake and build. When you include volk/volk.h you will
have access to volk_my_kern(params) and that handles the runtime selection.

Rename my_kern to follow the naming convention and contribute the work
back! :-)

-josh


> 18/09/2012, at 2:04 AM, Nick Foster wrote:
> 
>> Kyle,
>> 
>>  This sounds like a job for VOLK! 
>> 
>> Seriously, sounds like your block could benefit from all the nice
>> housekeeping that Volk takes care of for you, including runtime
>> auto-detection of platform support, conditional compiling based on
>> compiler support, and alignment reporting. Consider including at
>> least the crunchy SSE core in libvolk. Check out the Volk guide in
>> the documentation for instructions.
>> 
>> --n
>> 
>> On Sun, Sep 16, 2012 at 9:50 PM, Kyle Zhou 
>> wrote: I have a block which depends on sse2. I need to tell cmake
>> to check if the cpu support sse2 in order to determine if the sse2
>> acceleated version or a generic version should be used. This should
>> be straight forward. However, I just cannot find an example
>> CMakeLists.txt to get me a quick start. Any suggested readings?
>> thanks K Z ___ 
>> 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
> 

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


Re: [Discuss-gnuradio] how to test sse2 support using cmake

2012-09-20 Thread Kyle Zhou
Yes, I did look at it. but that is too overwhelming to me so far. need to work 
harder :(

On 17/09/2012, at 9:40 PM, Robert McGwier wrote:

> How about looking at the libvolk components and see how SSE is done and mimic?
> 
> On Sep 17, 2012 12:51 AM, "Kyle Zhou"  wrote:
> I have a block which depends on sse2. I need to tell cmake to check if the 
> cpu support sse2 in order to determine if the sse2 acceleated version or a 
> generic version should be used.
> This should be straight forward. However, I just cannot find an example 
> CMakeLists.txt to get me a quick start.
> Any suggested readings? thanks
> K Z
> ___
> 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] how to test sse2 support using cmake

2012-09-20 Thread Kyle Zhou
Thanks Nick.
Yes, I would like to migrate to volk and avoid all the hassles. Need to take 
some time to learn volk first.
Can I assume volk can perform most of the intrinsics of sse2?
Regards
KZ
On 18/09/2012, at 2:04 AM, Nick Foster wrote:

> Kyle,
> 
>  This sounds like a job for VOLK! 
> 
> Seriously, sounds like your block could benefit from all the nice 
> housekeeping that Volk takes care of for you, including runtime 
> auto-detection of platform support, conditional compiling based on compiler 
> support, and alignment reporting. Consider including at least the crunchy SSE 
> core in libvolk. Check out the Volk guide in the documentation for 
> instructions.
> 
> --n
> 
> On Sun, Sep 16, 2012 at 9:50 PM, Kyle Zhou  wrote:
> I have a block which depends on sse2. I need to tell cmake to check if the 
> cpu support sse2 in order to determine if the sse2 acceleated version or a 
> generic version should be used.
> This should be straight forward. However, I just cannot find an example 
> CMakeLists.txt to get me a quick start.
> Any suggested readings? thanks
> K Z
> ___
> 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] how to test sse2 support using cmake

2012-09-17 Thread Nick Foster
Kyle,

 This sounds like a job for VOLK! 

Seriously, sounds like your block could benefit from all the nice
housekeeping that Volk takes care of for you, including runtime
auto-detection of platform support, conditional compiling based on compiler
support, and alignment reporting. Consider including at least the crunchy
SSE core in libvolk. Check out the Volk guide in the documentation for
instructions.

--n

On Sun, Sep 16, 2012 at 9:50 PM, Kyle Zhou  wrote:

> I have a block which depends on sse2. I need to tell cmake to check if the
> cpu support sse2 in order to determine if the sse2 acceleated version or a
> generic version should be used.
> This should be straight forward. However, I just cannot find an example
> CMakeLists.txt to get me a quick start.
> Any suggested readings? thanks
> K Z
> ___
> 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] how to test sse2 support using cmake

2012-09-17 Thread Robert McGwier
How about looking at the libvolk components and see how SSE is done and
mimic?
On Sep 17, 2012 12:51 AM, "Kyle Zhou"  wrote:

> I have a block which depends on sse2. I need to tell cmake to check if the
> cpu support sse2 in order to determine if the sse2 acceleated version or a
> generic version should be used.
> This should be straight forward. However, I just cannot find an example
> CMakeLists.txt to get me a quick start.
> Any suggested readings? thanks
> K Z
> ___
> 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


[Discuss-gnuradio] how to test sse2 support using cmake

2012-09-16 Thread Kyle Zhou
I have a block which depends on sse2. I need to tell cmake to check if the cpu 
support sse2 in order to determine if the sse2 acceleated version or a generic 
version should be used.
This should be straight forward. However, I just cannot find an example 
CMakeLists.txt to get me a quick start.
Any suggested readings? thanks
K Z
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio