On Wed, Sep 16, 2015 at 3:58 PM, Dennis Glatting <gnura...@pki2.com> wrote:
>
>
> It would also be nice to have a VOLK kernel that multiples a vector by a
> constant:
>
>    void
>    volk_32f_s32f_multiply( float* vecbuffer,
>                            const float scalar,
>                            unsigned int num_points )
>

There is a volk_32f_s32f_multiply_32f. It doesn't operate in-place, but
almost none of the VOLK kernels do. I think it's safe to give the same
output buffer as input buffer. (I've heard that doing stuff in-place is
noticeably better, but I've never tested this and I'm a tad skeptical. I'll
buy someone a beer whenever I see them if they prove me wrong with >= 5
kernels)


>
> And an alias for volk_32f_s32f_normalize(): volk_32f_s32f_divide().
>

You could call volk_32f_s32f_multiply_32f and have the constant be
1/scalar... In a VOLK kernel that's what we would do anyway since
multiplication operations don't exist in every ISA we care about and when
they do sometimes multiplication is still faster (again, talking floats
here).


>
> These would somewhat map to operations in MATLAB with less learners asking
> "how do I...?".
>
>
I suppose you're right that for completeness it might make sense to add a
float divide scalar kernel, but it would do exactly the multiple kernel
except first divide 1/scalar.

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

Reply via email to