Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about FIR using inner product #144

Open
ghost opened this issue Jun 13, 2021 · 0 comments
Open

Question about FIR using inner product #144

ghost opened this issue Jun 13, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2021

Hi Roman, sorry to ask you something maybe naïve, but I have add a little class to a FIR Benchmark produce by jatinchowdhury18 repo, you can find the issue here : New promising benchmark using Fastor C++

Fastor outperform the other inner_product implementation except with small kernel size and I'm sure that I don't use Fastor correctly. In the main processing loop (over the sample buffer), I can't call Fastor::inner directly with a subview like that:

buffer[n] = Fastor::inner(z(Fastor::seq(zPtr, zPtr + N)), h);

where N is the templated FIR order, h is the FIR coefficients tensor of the impulse response, z a double-buffer state tensor related of the z-N essence of the FIR equation and buffer the sample buffer that receive the discrete convolution result.

I need to cast the subview like that to allow compilation:

Fastor::Tensor<float, N> zn = z(Fastor::seq(zPtr, zPtr + N, 1));
buffer[n] = Fastor::inner(zn, h);

Even if the method outperform the other method on kernel > 32 (in the benchmark of power of 2), I'm pretty sure that the assignment operator in the main loop is a bottleneck for smaller sizes kernels.

Why can I directly call Fastor::inner with the subview ? What is wrong with my code ?

Thank you very much for you answer and your time !!!

@ghost ghost changed the title Question about FIR-like using inner product Question about FIR using inner product Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants