Closed skgbanga closed 4 years ago
Dear @skgbanga,
that's a good point! This kind of very strict checking is probably a fairly narrow use case, but it would be good if there was a way to disable the Enoki optimization in such a case.
What I would suggest is to introduce a new enum ENOKI_DISABLE_3D_SPECIAL_CASE
and wrapping the partial template overloads at the end of array_sse.h, array_avx[2].h with a corresponding #if !defined(..)
.
Best, Wenzel
(Please feel free to create a PR with this change, once you have checked that it addresses your issue.)
@wjakob
For now, I have initialized all my enoki arrays with sensible defaults.(even the 4th element) because I do want to use that optimization.
I will submit a PR separately with your recommendation though.
Closing this ticket.
Hello,
As the documentation says, 3D arrays are treated as 4D arrays to make better used of intrinsics, but this raises an interesting problem.
Consider the following code:
This throws the exception because the last number in the Register is initialized to 0, and this leads to a division by zero. Note that this is not limited to division. Any operation on the last number (things like min, max) also trigger than exception.
We do a bunch of floating point computation and like to keep the floating point exception check to verify we didn't mess up.
I was wondering what is your suggestion to handle cases like this?