[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/28: gr-basic: volkified the add fn for f
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/28: gr-basic: volkified the add fn for f32 |
Date: |
Mon, 15 Aug 2016 00:47:04 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag gr_basic_work
in repository gnuradio.
commit ee747e8a504abc67f8a6c95b5097547a7dca37ea
Author: Nick Foster <address@hidden>
Date: Tue Nov 8 15:39:48 2011 -0800
gr-basic: volkified the add fn for f32
---
gr-basic/lib/CMakeLists.txt | 2 ++
gr-basic/lib/gr_basic_add.cc | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gr-basic/lib/CMakeLists.txt b/gr-basic/lib/CMakeLists.txt
index dd4e551..71e9ff7 100644
--- a/gr-basic/lib/CMakeLists.txt
+++ b/gr-basic/lib/CMakeLists.txt
@@ -26,6 +26,7 @@ include_directories(
)
include_directories(${Boost_INCLUDE_DIRS})
+include_directories(${VOLK_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
########################################################################
@@ -38,6 +39,7 @@ list(APPEND gr_basic_sources
list(APPEND basic_libs
gnuradio-core
${Boost_LIBRARIES}
+ volk
)
add_library(gnuradio-basic SHARED ${gr_basic_sources})
diff --git a/gr-basic/lib/gr_basic_add.cc b/gr-basic/lib/gr_basic_add.cc
index 62e4207..b9bb879 100644
--- a/gr-basic/lib/gr_basic_add.cc
+++ b/gr-basic/lib/gr_basic_add.cc
@@ -23,6 +23,7 @@
#include <gr_io_signature.h>
#include <stdexcept>
#include <complex>
+#include <volk/volk.h>
/***********************************************************************
* Adder implementation with complex float 32
@@ -39,7 +40,9 @@ public:
),
_vlen(vlen)
{
- //TODO this is where you set output multiple for volk
+ int alignment_multiple = volk_get_alignment() / (sizeof(my_type)*vlen);
+ if(alignment_multiple < 1) alignment_multiple = 1;
+ set_output_multiple(alignment_multiple);
}
int work(
@@ -54,11 +57,16 @@ public:
for (size_t n = 1; n < input_items.size(); n++){
const my_type *in = reinterpret_cast<const my_type
*>(input_items[n]);
//TODO - this is where you call into volk
+ volk_32f_x2_add_32f_a((float *)out, (float *)in0, (float *)in,
n_nums*2);
+ /*
for (size_t i = 0; i < n_nums; i++){
out[i] = in0[i] + in[i];
}
+ */
in0 = out; //for next input, we do output += input
}
+
+ return noutput_items;
}
private:
- [Commit-gnuradio] [gnuradio] annotated tag gr_basic_work created (now ac6eec1), git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 02/28: gr-basic: volkified the add fn for f32,
git <=
- [Commit-gnuradio] [gnuradio] 14/28: basic: integrated volk routine for float multiply const, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 23/28: Merge branch 'inplace_blocks' of gnuradio.org:jblum into gr_basic, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 10/28: Volk: add 32fc_s32fc_multiply_32fc to profiler, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 06/28: basic: call volk for float32 multiplier types, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 09/28: Volk: added 32fc x scalar multiply, implemented in Orc & generic. Orc/SSE tested 10x faster than generic., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 25/28: core: added set_output_alignment (policy 2 version), git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 11/28: basic: use volk multiply scalar function for multiply_const fc32, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 24/28: basic: set inplace on gr-basic math blocks, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 16/28: basic: performance tweak for sig source index mod, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 04/28: basic: added other basic operators, git, 2016/08/14