diff options
author | Nick Foster | 2010-12-14 22:58:33 -0800 |
---|---|---|
committer | Nick Foster | 2010-12-14 22:58:33 -0800 |
commit | f9ee6a55cb397f9302769a25a8c959fa162354f0 (patch) | |
tree | 194211146c78f5cb56ea9ab8c72b231eaba31986 /volk/lib | |
parent | 21426265324c883c91eeaaf75a81f2ccdc6e249d (diff) | |
download | gnuradio-f9ee6a55cb397f9302769a25a8c959fa162354f0.tar.gz gnuradio-f9ee6a55cb397f9302769a25a8c959fa162354f0.tar.bz2 gnuradio-f9ee6a55cb397f9302769a25a8c959fa162354f0.zip |
Volk: Some new basic Orc implementations with QA code
Diffstat (limited to 'volk/lib')
-rw-r--r-- | volk/lib/qa_16u_byteswap_aligned16.cc | 1 | ||||
-rw-r--r-- | volk/lib/qa_32f_divide_aligned16.cc | 10 | ||||
-rw-r--r-- | volk/lib/qa_32f_multiply_aligned16.cc | 9 | ||||
-rw-r--r-- | volk/lib/qa_32f_subtract_aligned16.cc | 9 |
4 files changed, 29 insertions, 0 deletions
diff --git a/volk/lib/qa_16u_byteswap_aligned16.cc b/volk/lib/qa_16u_byteswap_aligned16.cc index c30b6ba41..b740f91df 100644 --- a/volk/lib/qa_16u_byteswap_aligned16.cc +++ b/volk/lib/qa_16u_byteswap_aligned16.cc @@ -30,6 +30,7 @@ void qa_16u_byteswap_aligned16::t1() { output0[i] = (uint16_t) ((rand() - (RAND_MAX/2)) / (RAND_MAX/2)); } memcpy(output01, output0, vlen*sizeof(uint16_t)); + memcpy(output02, output0, vlen*sizeof(uint16_t)); printf("16u_byteswap_aligned\n"); diff --git a/volk/lib/qa_32f_divide_aligned16.cc b/volk/lib/qa_32f_divide_aligned16.cc index 8826bf94f..f104e0443 100644 --- a/volk/lib/qa_32f_divide_aligned16.cc +++ b/volk/lib/qa_32f_divide_aligned16.cc @@ -35,6 +35,7 @@ void qa_32f_divide_aligned16::t1() { float input1[vlen] __attribute__ ((aligned (16))); float output0[vlen] __attribute__ ((aligned (16))); + float output1[vlen] __attribute__ ((aligned (16))); float output_known[vlen] __attribute__ ((aligned (16))); for(int i = 0; i < vlen; ++i) { @@ -51,6 +52,14 @@ void qa_32f_divide_aligned16::t1() { end = clock(); total = (double)(end-start)/(double)CLOCKS_PER_SEC; printf("generic_time: %f\n", total); + + start = clock(); + for(int count = 0; count < ITERS; ++count) { + volk_32f_divide_aligned16_manual(output1, input0, input1, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); /* for(int i = 0; i < 10; ++i) { @@ -61,6 +70,7 @@ void qa_32f_divide_aligned16::t1() { for(int i = 0; i < vlen; ++i) { CPPUNIT_ASSERT_EQUAL(output0[i], output_known[i]); + CPPUNIT_ASSERT_EQUAL(output1[i], output_known[i]); } } diff --git a/volk/lib/qa_32f_multiply_aligned16.cc b/volk/lib/qa_32f_multiply_aligned16.cc index e52748466..f9c034d70 100644 --- a/volk/lib/qa_32f_multiply_aligned16.cc +++ b/volk/lib/qa_32f_multiply_aligned16.cc @@ -78,6 +78,7 @@ void qa_32f_multiply_aligned16::t1() { float output0[vlen] __attribute__ ((aligned (16))); float output01[vlen] __attribute__ ((aligned (16))); + float output02[vlen] __attribute__ ((aligned (16))); for(int i = 0; i < vlen; ++i) { input0[i] = ((float) (rand() - (RAND_MAX/2))) / static_cast<float>((RAND_MAX/2)); @@ -94,6 +95,13 @@ void qa_32f_multiply_aligned16::t1() { printf("generic_time: %f\n", total); start = clock(); for(int count = 0; count < ITERS; ++count) { + volk_32f_multiply_aligned16_manual(output02, input0, input1, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); + start = clock(); + for(int count = 0; count < ITERS; ++count) { volk_32f_multiply_aligned16_manual(output01, input0, input1, vlen, "sse"); } end = clock(); @@ -107,6 +115,7 @@ void qa_32f_multiply_aligned16::t1() { for(int i = 0; i < vlen; ++i) { //printf("%d...%d\n", output0[i], output01[i]); CPPUNIT_ASSERT_EQUAL(output0[i], output01[i]); + CPPUNIT_ASSERT_EQUAL(output0[i], output02[i]); } } diff --git a/volk/lib/qa_32f_subtract_aligned16.cc b/volk/lib/qa_32f_subtract_aligned16.cc index a7e1b5ae3..5a5a7c9b6 100644 --- a/volk/lib/qa_32f_subtract_aligned16.cc +++ b/volk/lib/qa_32f_subtract_aligned16.cc @@ -25,6 +25,7 @@ void qa_32f_subtract_aligned16::t1() { float output0[vlen] __attribute__ ((aligned (16))); float output01[vlen] __attribute__ ((aligned (16))); + float output02[vlen] __attribute__ ((aligned (16))); for(int i = 0; i < vlen; ++i) { input0[i] = ((float) (rand() - (RAND_MAX/2))) / static_cast<float>((RAND_MAX/2)); @@ -41,6 +42,13 @@ void qa_32f_subtract_aligned16::t1() { printf("generic_time: %f\n", total); start = clock(); for(int count = 0; count < ITERS; ++count) { + volk_32f_subtract_aligned16_manual(output02, input0, input1, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); + start = clock(); + for(int count = 0; count < ITERS; ++count) { volk_32f_subtract_aligned16_manual(output01, input0, input1, vlen, "sse"); } end = clock(); @@ -54,6 +62,7 @@ void qa_32f_subtract_aligned16::t1() { for(int i = 0; i < vlen; ++i) { //printf("%d...%d\n", output0[i], output01[i]); CPPUNIT_ASSERT_EQUAL(output0[i], output01[i]); + CPPUNIT_ASSERT_EQUAL(output0[i], output02[i]); } } |