| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thanks a lot! It could be nice to do the workaround only on MSVC (on potentially only on the affected version) using some pre-processor statement? |
Sorry, something went wrong.
|
pushed with msvc guards. I also added a test which I think covers all 3 issues. |
Sorry, something went wrong.
|
I would have probably only added #if defined(_MSC_VER) && (1931 <= _MSC_VER)
// Workaround MSVC compiler optimization bug, xtensor#2568
if (shape.size() == 0) {
return static_cast<std::size_t>(data_size);
}
#endif to keep the implementation cleaner. That should work too no? |
Sorry, something went wrong.
|
oh. yes, that's much better. I'll fix that up |
Sorry, something went wrong.
…on faults in optimized (/O1 /O2 builds. - this should fix 0-sized xarrays, xtensors (xt::xtensor<size_t, 0>), xt::argmax()
|
This is amazing! It may be worth adding a comment and a reference to this compiler issue in https://xtensor.readthedocs.io/en/latest/compilers.html. |
Sorry, something went wrong.
|
Would something like the following do? (not so familiar with .rst) Visual Studio 2022 (19.31+) workaround inline compiler optimization bug ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In `xstrides.hpp`, added an early return inside `compute_strides` when ``shape.size() == 0`` to prevent a run time crash from occuring. Without this guard statement, instructions from inside the for loop were somehow being reached, despite being logically unreachable. Original issue `here. <https://github.com/xtensor-stack/xtensor/issues/2568>`_ Upstream issue `here. <https://developercommunity.visualstudio.com/t/Runtime-Crash-msvc--1931-with-optimiz/10134617>`_ |
Sorry, something went wrong.
|
Great! Good to go. Thanks a lot for getting to the bottom of this |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Works around an msvc optimizer bug which occurs when shape.size() == 0.
Surrounding the problematic region to prevent illegal access that occurs on windows MSVC optimized builds (/O1, /O2).
Checklist
Description
Fixes #2551
Fixes #2568
Fixes #2596