thrust icon indicating copy to clipboard operation
thrust copied to clipboard

Fix building against libc++ on Windows

Open georgthegreat opened this issue 3 years ago • 4 comments

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).

georgthegreat avatar Aug 26 '22 18:08 georgthegreat

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.

GPUtester avatar Aug 26 '22 18:08 GPUtester

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

miscco avatar Aug 29 '22 18:08 miscco

So, how do I make thrust compile againt different STL on Windows? I can check microsoft/stl specific define if it has one.

georgthegreat avatar Aug 29 '22 19:08 georgthegreat

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)

miscco avatar Aug 29 '22 20:08 miscco