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

Various kernels with 16i inputs do not handle integer overflow consistently #707

Open
argilo opened this issue Nov 11, 2023 · 2 comments
Open
Labels

Comments

@argilo
Copy link
Member

argilo commented Nov 11, 2023

In #77, the range of integers used when testing 16i inputs was reduced to -7 .. +7, to accommodate the volk_16ic_x2_dot_prod_16ic kernel which does not handle integer overflows consistently between its various protokernels. In fact, other kernels suffer from the same problem. If the testing range is increased to std::numeric_limits<int16_t>::min() .. std::numeric_limits<int16_t>::max(), then the following tests fail:

  • qa_volk_16i_32fc_dot_prod_32fc
  • qa_volk_16ic_magnitude_16i
  • qa_volk_16ic_x2_dot_prod_16ic
  • qa_volk_16ic_x2_multiply_16ic

Overflows in volk_16ic_x2_dot_prod_16ic cause sporadic test failures even with the reduced range, as documented in #676; #706 should improve the situation, but in the longer term, either these kernels should be improved to handle overflows consistently, or the limitations of these kernels should be documented and the test framework should ensure that inputs do not stray outside the documented limits.

@argilo argilo added the bug label Nov 11, 2023
@jdemel
Copy link
Contributor

jdemel commented Jan 12, 2024

Do you suggest to add a comment in the kernel doc section that states:
Kernel is prone to overflow. Users are encouraged to ensure overflows don't happen or deal with if accordingly.?

@argilo
Copy link
Member Author

argilo commented Jan 12, 2024

That's a good start, but it would be nice to be a bit more specific about when an overflow could occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants