Clang changes to make use of the LLVM intrinsics added in D21160.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
(Art, I would appreciate a second set of eyes on this one, as the last time I did this -- with ldg -- I messed up pretty badly.)
lib/Headers/__clang_cuda_intrinsics.h | ||
---|---|---|
77–80 ↗ | (On Diff #60125) | Could we use a union instead? |
87 ↗ | (On Diff #60125) | Ugh. Took me a while to figure out why 0 is used here. |
Update after tra's review.
lib/Headers/__clang_cuda_intrinsics.h | ||
---|---|---|
77–80 ↗ | (On Diff #60125) | I'm pretty sure using a union for this purpose is UB in C++. "[9.5.1] In a union, at most one of the non-static data members can be active at any time, that is, the value of at most one of the non-static data members can be stored in a union at any time" Although apparently it's fine in C11, http://stackoverflow.com/questions/25664848/unions-and-type-punning |
87 ↗ | (On Diff #60125) | Done, thanks. |