From 239144659b29c0a5ecd83a34e0e57387a1060ed7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 7 Dec 2010 18:50:28 -0500 Subject: Initial checkin for VOLK - Vector-Optimized Library of Kernels. This is a new SIMD library. It currently stands by itself under the GNU Radio tree and can be used separately. We will integrate the build process into GNU Raio and start building off of its functionality over time. --- volk/lib/qa_64u_popcnt_aligned16.cc | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 volk/lib/qa_64u_popcnt_aligned16.cc (limited to 'volk/lib/qa_64u_popcnt_aligned16.cc') diff --git a/volk/lib/qa_64u_popcnt_aligned16.cc b/volk/lib/qa_64u_popcnt_aligned16.cc new file mode 100644 index 000000000..bce9ff6c2 --- /dev/null +++ b/volk/lib/qa_64u_popcnt_aligned16.cc @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include + +//test for sse + +#ifndef LV_HAVE_SSE4_2 + +void qa_64u_popcnt_aligned16::t1() { + printf("sse4.2 not available... no test performed\n"); +} + +#else + +void qa_64u_popcnt_aligned16::t1() { + + + volk_runtime_init(); + + volk_environment_init(); + clock_t start, end; + double total; + + const int ITERS = 10000000; + uint64_t input0 __attribute__ ((aligned (16))); + + uint64_t output0 __attribute__ ((aligned (16))); + uint64_t output01 __attribute__ ((aligned (16))); + + input0 = ((uint64_t) (rand() - (RAND_MAX/2))); + output0 = 0; + output01 = 0; + + printf("64u_popcnt_aligned\n"); + + start = clock(); + uint64_t ret = 0; + for(int count = 0; count < ITERS; ++count) { + volk_64u_popcnt_aligned16_manual(&ret, input0, "generic"); + output0 += ret; + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("generic_time: %f\n", total); + start = clock(); + ret = 0; + for(int count = 0; count < ITERS; ++count) { + get_volk_runtime()->volk_64u_popcnt_aligned16(&ret, input0); + output01 += ret; + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("sse4.2_time: %f\n", total); + + + CPPUNIT_ASSERT_EQUAL(output0, output01); +} + +#endif -- cgit From ce3e4c33d170b65cf288faec7d8da6a496eb6101 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 16 Dec 2010 21:33:54 -0500 Subject: Including time header to qa files. --- volk/lib/qa_64u_popcnt_aligned16.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'volk/lib/qa_64u_popcnt_aligned16.cc') diff --git a/volk/lib/qa_64u_popcnt_aligned16.cc b/volk/lib/qa_64u_popcnt_aligned16.cc index bce9ff6c2..85ef58795 100644 --- a/volk/lib/qa_64u_popcnt_aligned16.cc +++ b/volk/lib/qa_64u_popcnt_aligned16.cc @@ -3,6 +3,7 @@ #include #include #include +#include //test for sse -- cgit From 0b3e4f25eea1eef3e8a45fdb6d1bcc1ec57d1321 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 17 Apr 2011 23:03:18 -0700 Subject: volk: replace references to __attribute__((aligned... with cross platform macro This replaces all aligned(16) and aligned(128) (which were incorrect). Attribute macros are on the left because this makes gcc and ms compilers happy. --- volk/lib/qa_64u_popcnt_aligned16.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'volk/lib/qa_64u_popcnt_aligned16.cc') diff --git a/volk/lib/qa_64u_popcnt_aligned16.cc b/volk/lib/qa_64u_popcnt_aligned16.cc index 85ef58795..6be4e50ea 100644 --- a/volk/lib/qa_64u_popcnt_aligned16.cc +++ b/volk/lib/qa_64u_popcnt_aligned16.cc @@ -25,10 +25,10 @@ void qa_64u_popcnt_aligned16::t1() { double total; const int ITERS = 10000000; - uint64_t input0 __attribute__ ((aligned (16))); + __VOLK_ATTR_ALIGNED(16) uint64_t input0; - uint64_t output0 __attribute__ ((aligned (16))); - uint64_t output01 __attribute__ ((aligned (16))); + __VOLK_ATTR_ALIGNED(16) uint64_t output0; + __VOLK_ATTR_ALIGNED(16) uint64_t output01; input0 = ((uint64_t) (rand() - (RAND_MAX/2))); output0 = 0; -- cgit From f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 13 Apr 2012 18:36:53 -0400 Subject: Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future. The sed script was provided by Moritz Fischer. --- volk/lib/qa_64u_popcnt_aligned16.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'volk/lib/qa_64u_popcnt_aligned16.cc') diff --git a/volk/lib/qa_64u_popcnt_aligned16.cc b/volk/lib/qa_64u_popcnt_aligned16.cc index 6be4e50ea..391601f22 100644 --- a/volk/lib/qa_64u_popcnt_aligned16.cc +++ b/volk/lib/qa_64u_popcnt_aligned16.cc @@ -16,8 +16,8 @@ void qa_64u_popcnt_aligned16::t1() { #else void qa_64u_popcnt_aligned16::t1() { - - + + volk_runtime_init(); volk_environment_init(); @@ -26,7 +26,7 @@ void qa_64u_popcnt_aligned16::t1() { const int ITERS = 10000000; __VOLK_ATTR_ALIGNED(16) uint64_t input0; - + __VOLK_ATTR_ALIGNED(16) uint64_t output0; __VOLK_ATTR_ALIGNED(16) uint64_t output01; @@ -55,7 +55,7 @@ void qa_64u_popcnt_aligned16::t1() { total = (double)(end-start)/(double)CLOCKS_PER_SEC; printf("sse4.2_time: %f\n", total); - + CPPUNIT_ASSERT_EQUAL(output0, output01); } -- cgit