diff options
author | Nick Foster | 2011-11-09 12:46:00 -0800 |
---|---|---|
committer | Josh Blum | 2011-12-01 09:08:28 -0500 |
commit | 7695ca06f1b565723f3fc302d7b7818e93d86a57 (patch) | |
tree | 1ec002e515f609e0e16856a8264f6ba15a496d8d | |
parent | 73727e316ae9addf8ffbc3b3473ace15d993d7b8 (diff) | |
download | gnuradio-7695ca06f1b565723f3fc302d7b7818e93d86a57.tar.gz gnuradio-7695ca06f1b565723f3fc302d7b7818e93d86a57.tar.bz2 gnuradio-7695ca06f1b565723f3fc302d7b7818e93d86a57.zip |
Volk: 32f_s32f_multiply_32f
-rw-r--r-- | volk/apps/volk_profile.cc | 1 | ||||
-rw-r--r-- | volk/include/volk/volk_32f_s32f_multiply_32f_a.h | 44 | ||||
-rw-r--r-- | volk/lib/testqa.cc | 1 |
3 files changed, 46 insertions, 0 deletions
diff --git a/volk/apps/volk_profile.cc b/volk/apps/volk_profile.cc index 86bf72176..674ab7115 100644 --- a/volk/apps/volk_profile.cc +++ b/volk/apps/volk_profile.cc @@ -103,6 +103,7 @@ int main(int argc, char *argv[]) { VOLK_PROFILE(volk_8i_s32f_convert_32f_a, 1e-4, 100, 204600, 2000, &results); VOLK_PROFILE(volk_8i_s32f_convert_32f_u, 1e-4, 100, 204600, 2000, &results); VOLK_PROFILE(volk_32fc_s32fc_multiply_32fc_a, 1e-4, 0, 204600, 1000, &results); + VOLK_PROFILE(volk_32f_s32f_multiply_32f_a, 1e-4, 0, 204600, 1000, &results); char path[256]; get_config_path(path); diff --git a/volk/include/volk/volk_32f_s32f_multiply_32f_a.h b/volk/include/volk/volk_32f_s32f_multiply_32f_a.h new file mode 100644 index 000000000..6aef1735c --- /dev/null +++ b/volk/include/volk/volk_32f_s32f_multiply_32f_a.h @@ -0,0 +1,44 @@ +#ifndef INCLUDED_volk_32f_s32f_multiply_32f_a_H +#define INCLUDED_volk_32f_s32f_multiply_32f_a_H + +#include <inttypes.h> +#include <stdio.h> + +#ifdef LV_HAVE_GENERIC +/*! + \brief Scalar float multiply + \param cVector The vector where the results will be stored + \param aVector One of the vectors to be multiplied + \param scalar the scalar value + \param num_points The number of values in aVector and bVector to be multiplied together and stored into cVector +*/ +static inline void volk_32f_s32f_multiply_32f_a_generic(float* cVector, float* aVector, const float scalar, unsigned int num_points){ + unsigned int number = 0; + float* inputPtr = aVector; + float* outputPtr = cVector; + for(number = 0; number < num_points; number++){ + *outputPtr = (*inputPtr) * scalar; + inputPtr++; + outputPtr++; + } +} +#endif /* LV_HAVE_GENERIC */ + +#ifdef LV_HAVE_ORC +/*! + \brief Scalar float multiply + \param cVector The vector where the results will be stored + \param aVector One of the vectors to be multiplied + \param scalar the scalar value + \param num_points The number of values in aVector and bVector to be multiplied together and stored into cVector +*/ +extern void volk_32f_s32f_multiply_32f_a_orc_impl(float* dst, float* src, const float scalar, unsigned int num_points); +static inline void volk_32f_s32f_multiply_32f_a_orc(float* cVector, float* aVector, const float scalar, unsigned int num_points){ + volk_32f_s32f_multiply_32f_a_orc_impl(cVector, aVector, scalar, num_points); +} +#endif /* LV_HAVE_GENERIC */ + + + + +#endif /* INCLUDED_volk_32f_s32f_multiply_32f_a_H */ diff --git a/volk/lib/testqa.cc b/volk/lib/testqa.cc index 9d1d1bca2..cd9f38dfa 100644 --- a/volk/lib/testqa.cc +++ b/volk/lib/testqa.cc @@ -4,6 +4,7 @@ //VOLK_RUN_TESTS(volk_16i_x5_add_quad_16i_x4_a, 1e-4, 2046, 10000); //VOLK_RUN_TESTS(volk_16i_branch_4_state_8_a, 1e-4, 2046, 10000); +VOLK_RUN_TESTS(volk_32f_s32f_multiply_32f_a, 1e-4, 0, 204600, 10000); VOLK_RUN_TESTS(volk_32fc_s32fc_multiply_32fc_a, 1e-4, 0, 20460, 10000); VOLK_RUN_TESTS(volk_16ic_s32f_deinterleave_real_32f_a, 1e-5, 32768.0, 204600, 10000); VOLK_RUN_TESTS(volk_16ic_deinterleave_real_8i_a, 0, 0, 20460, 10000); |