Commit 69e9b6e
[rocm-libraries] ROCm/rocm-libraries#4905 (commit 2b42a42)
[rocthrust] Fix unqualified swap calls in
contiguous_storage.inl (#4905)
## Motivation
<!-- Explain the purpose of this PR and the goals it aims to achieve.
-->
This PR fixes a couple of unqualified swap calls caused ADL ambiguity
with libhipcxx 3.0.2.
## Technical Details
<!-- Explain the changes along with any relevant GitHub links. -->
Unqualified swap() calls in thrust/detail/contiguous_storage.inl cause
compilation failures when used with cuda::std namespace types due to ADL
ambiguity between thrust::swap and cuda::std::swap. The ambiguity is
removed by explicit calls to thrust::swap when
_THRUST_HAS_DEVICE_SYSTEM_STD is not defined. When
_THRUST_HAS_DEVICE_SYSTEM_STD is defined, std::swap provides a fallback
while allowing customized swap implementation via ADL - this is to be
consistent with CCCL.
## Test Plan
<!-- Explain any relevant testing done to verify this PR. -->
Build a reproducer that uses cuda::std namespace types in host_vector.
## Test Result
<!-- Briefly summarize test outcomes. -->
The compilation is successful.
## Submission Checklist
- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.1 parent d2001b0 commit 69e9b6e
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | 201 | | |
206 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
| |||
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| 364 | + | |
360 | 365 | | |
361 | | - | |
| 366 | + | |
362 | 367 | | |
363 | | - | |
364 | 368 | | |
365 | 369 | | |
366 | 370 | | |
| |||
0 commit comments