thrust
thrust copied to clipboard
Fix building against libc++ on Windows
In microsoft/stl std::_Unwrapped_t is just std::remove_cvref_t (and before C++20 you have to combine the latter from std::remove_reference and std::remove_cv).
Can one of the admins verify this patch?
Admins can comment ok to test to allow this one PR to run or add to allowlist to allow all future PRs from the same author to run.
Unfortunately that is not the whole truth.
MSVC has checked iterators for their containers. Those e.g do additional bounds checking in Debug builds.
The unwrapped iterators do not do anything in that regard, but might be different types.
E.g. for std::vector we have a bespoke iterator class and the unwrapped iterator is just a plain pointer. https://github.com/microsoft/STL/blob/8ca7bd3c002d383940de9abe6379721e96eb12e3/stl/inc/vector#L1909-L1923
So, how do I make thrust compile againt different STL on Windows? I can check microsoft/stl specific define if it has one.
That depends a lot on what you want to do. What VS version do you have, what CUDA version etc. (AFAIK 11.6 is needed for current MSVC STL)