diff --git a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/base.hpp b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/base.hpp index 8c8214e0c3a6..8b81ad9f706e 100644 --- a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/base.hpp +++ b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/base.hpp @@ -1,30 +1,6 @@ -/****************************************************************************** - * Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved. - * Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the NVIDIA CORPORATION nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ******************************************************************************/ +// SPDX-FileCopyrightText: Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved. +// SPDX-FileCopyrightText: Modifications Copyright (c) 2024-2026 Advanced Micro Devices, Inc. All rights reserved. +// SPDX-License-Identifier: BSD-3 #pragma once diff --git a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/by_key.hpp b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/by_key.hpp index 8b8e5f062c77..21a026a55e4a 100644 --- a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/by_key.hpp +++ b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/set_operations/by_key.hpp @@ -1,30 +1,6 @@ -/****************************************************************************** - * Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved. - * Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the NVIDIA CORPORATION nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ******************************************************************************/ +// SPDX-FileCopyrightText: Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved. +// SPDX-FileCopyrightText: Modifications Copyright (c) 2024-2026 Advanced Micro Devices, Inc. All rights reserved. +// SPDX-License-Identifier: BSD-3 #pragma once diff --git a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/transform/basic.cu b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/transform/basic.cu index e96824daf69d..1324aeb5aaa5 100644 --- a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/transform/basic.cu +++ b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/transform/basic.cu @@ -1,30 +1,6 @@ -/****************************************************************************** - * Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. - * Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the NVIDIA CORPORATION nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ******************************************************************************/ +// SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SPDX-FileCopyrightText: Modifications Copyright (c) 2024-2026 Advanced Micro Devices, Inc. All rights reserved. +// SPDX-License-Identifier: BSD-3 // Benchmark utils #include "bench_utils.hpp" diff --git a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/vectorized_search/basic.cu b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/vectorized_search/basic.cu index 1eb3eeb36cd2..afedf3157b80 100644 --- a/projects/hipccl/hipccl3/rocthrust/benchmark/bench/vectorized_search/basic.cu +++ b/projects/hipccl/hipccl3/rocthrust/benchmark/bench/vectorized_search/basic.cu @@ -1,30 +1,6 @@ -/****************************************************************************** - * Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved. - * Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the NVIDIA CORPORATION nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ******************************************************************************/ +// SPDX-FileCopyrightText: Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved. +// SPDX-FileCopyrightText: Modifications Copyright (c) 2024-2026 Advanced Micro Devices, Inc. All rights reserved. +// SPDX-License-Identifier: BSD-3 // Benchmark utils #include "bench_utils.hpp" diff --git a/projects/hipccl/hipccl3/rocthrust/cccl-investigation-v3.2.1.md b/projects/hipccl/hipccl3/rocthrust/cccl-investigation-v3.2.1.md deleted file mode 100644 index 14f45afbe20a..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/cccl-investigation-v3.2.1.md +++ /dev/null @@ -1,165 +0,0 @@ -# CCCL → rocThrust Sync Investigation: v3.1.0 → v3.2.1 - -What changes in rocThrust when syncing CCCL v3.1.0 → v3.2.1, and -what work that implies. No code has been ported yet. - -## Summary - -- **JIRA ticket**: none -- **Base branch**: `users/matyas-streamhpc/hipccl/rocthrust_cccl31` (the unmerged CCCL 3.1 sync, 86 commits ahead of `origin/develop`) -- **Baseline**: `v3.1.0` (confirmed by the human). `libcxx.h` on the base branch still requires libcu++/libhipcxx 3.0; this sync raises it to 3.2. -- **Target**: `v3.2.1` — tags covered: `v3.1.1 v3.1.2 v3.1.3 v3.1.4 v3.2.0 v3.2.1` -- **Upstream commits to port**: 136 touching `thrust/` (810 files changed). 8 are already on the base branch via the 3.1.0 backports, and 2 more are partly there (see §1). -- **Maintenance-branch drift**: `branch/3.2.x` has one commit past v3.2.1 that touches `thrust/`, [`21b3532227f`](https://github.com/NVIDIA/cccl/commit/21b3532227f) "Bump branch/3.2.x to 3.2.2" ([PR #7651](https://github.com/NVIDIA/cccl/pull/7651)). It's a version bump for an untagged release and is deliberately left out. - -v3.2 adds little new public Thrust API. It is mostly a large internal restructuring of Thrust. The ADL dispatch layer is inlined and `system/detail/adl/` is deleted. Execution policies, the allocator internals, and the OMP/TBB/sequential backends are rewritten, and most `*.inl` files are folded into headers. `thrust::pair` and other Thrust facilities are replaced internally by `cuda::std::` and `cuda::` equivalents. On top of that come repo-wide clang-format, SPDX-license and include-cleanup sweeps. The CUDA backend moves several algorithms onto `cub::DeviceTransform`; that part is NVIDIA-only for rocThrust's HIP/rocPRIM backend but must still land in `thrust/system/cuda/`. The main risk is the dependency on libcu++ 3.2 features. These include `cuda::zip_iterator`, `cuda::zip_transform_iterator`, `cuda::transform_input_output_iterator` and new `_CCCL_*` macros. The bundled libhipcxx is still at CCCL 3.0.2 and has none of them. libhipcxx will be bumped to at least 3.2, so these commits are ported directly and `libcxx.h` requires 3.2. The genuinely new features are OMP/TBB parallel scan and the new iterator interop. The fixes that matter for HIP are the memcpy-kind, memory-resource free and `shuffle` fixes. - ---- - -## 1. New features - -v3.1.1–v3.1.4 were cut from `branch/3.1.x`. Their only Thrust content is three fixes (`` for clang-cuda, `offset_iterator` tests, `detect_wrong_difference`), and the main-line originals of all three are in this range, listed under v3.2.0. v3.2.1's only Thrust change is the version bump. Everything below is v3.2.0. - -#### Already on the base branch - -The 3.1.0 backports already brought in these commits, so they should be ticked N/A after checking that nothing is missing: -- [`7825c40c8a6`](https://github.com/NVIDIA/cccl/commit/7825c40c8a6) PDL macro ([PR #5316](https://github.com/NVIDIA/cccl/pull/5316)) -- [`daf84b3d7f5`](https://github.com/NVIDIA/cccl/commit/daf84b3d7f5) and [`2e8d11a0e36`](https://github.com/NVIDIA/cccl/commit/2e8d11a0e36) `unique` via `DeviceSelect::Unique` ([PR #5396](https://github.com/NVIDIA/cccl/pull/5396), [PR #5566](https://github.com/NVIDIA/cccl/pull/5566)) -- [`d7fbce513a7`](https://github.com/NVIDIA/cccl/commit/d7fbce513a7) `unique` with non-const `equality_op` ([PR #5652](https://github.com/NVIDIA/cccl/pull/5652)) -- [`d046198a7ee`](https://github.com/NVIDIA/cccl/commit/d046198a7ee) `malloc` ([PR #5698](https://github.com/NVIDIA/cccl/pull/5698)) -- [`0b700f32b1e`](https://github.com/NVIDIA/cccl/commit/0b700f32b1e) extended-float forward declarations ([PR #5846](https://github.com/NVIDIA/cccl/pull/5846)) -- [`9fbba017026`](https://github.com/NVIDIA/cccl/commit/9fbba017026) `device_reference` nullptr ([PR #4226](https://github.com/NVIDIA/cccl/pull/4226)) -- [`57b16c2fc64`](https://github.com/NVIDIA/cccl/commit/57b16c2fc64) `__clz` ([PR #6099](https://github.com/NVIDIA/cccl/pull/6099)) - -Two commits were only partly backported by the 3.1 "iterator fixes" backport ([PR #5977](https://github.com/NVIDIA/cccl/pull/5977)). Only the remainder of each needs porting: -- [`e2dda739257`](https://github.com/NVIDIA/cccl/commit/e2dda739257) ([PR #5928](https://github.com/NVIDIA/cccl/pull/5928)): roughly 6 of 10 changed lines are already present. -- [`9e73f14e8f1`](https://github.com/NVIDIA/cccl/commit/9e73f14e8f1) ([PR #5929](https://github.com/NVIDIA/cccl/pull/5929)): roughly 16 of 24 changed lines are already present. - -### v3.2.0 - -#### New API -- **`cuda::zip_iterator` / `cuda::zip_function` interop** ([PR #5429](https://github.com/NVIDIA/cccl/pull/5429), [PR #6039](https://github.com/NVIDIA/cccl/pull/6039)) — Thrust specializes `iterator_system`/`iterator_traversal` for `cuda::zip_iterator`, and `thrust::transform` unwraps `cuda::zip_iterator`/`zip_function`. **To do:** add `_THRUST_LIBCXX::` specializations under `_THRUST_HAS_DEVICE_SYSTEM_STD`, as the 3.1 branch did for `permutation_iterator`. The types come from libhipcxx ≥ 3.2. -- **`cuda::transform_input_output_iterator` interop** ([PR #5113](https://github.com/NVIDIA/cccl/pull/5113)) — the same kind of trait specializations, plus tests. **To do:** port the same way as the zip iterators above. -- **`cuda::zip_transform_iterator` interop** ([PR #5982](https://github.com/NVIDIA/cccl/pull/5982)) — trait specializations, `thrust::copy` support, and a new benchmark. **To do:** port the same way; the benchmark is covered in §3. -- **Parallel scan for the OMP and TBB backends** ([PR #6178](https://github.com/NVIDIA/cccl/pull/6178), with the follow-up fix [PR #6704](https://github.com/NVIDIA/cccl/pull/6704)) — `inclusive_scan`/`exclusive_scan`/`*_by_key` now run in parallel under OMP and TBB. **To do:** port into `system/omp/` and `system/tbb/`, after the OMP/TBB restructuring in §4. -- **`transform_n` / `transform_if_n` overloads and a `DeviceTransform`-based `transform_if` in the CUDA system** ([PR #5238](https://github.com/NVIDIA/cccl/pull/5238), [PR #5198](https://github.com/NVIDIA/cccl/pull/5198)). **To do:** port into `system/cuda/`. Check whether `system/hip/detail/transform.h` needs matching overloads; the generic `transform_n` is already on the base branch. -- **New `sum_columns` example** ([PR #4462](https://github.com/NVIDIA/cccl/pull/4462)) — rocThrust already has `sum_rows.cu`. **To do:** add `examples/sum_columns.cu` and update `sum_rows.cu`. - -#### Behavior changes -- **CUDA algorithms routed through `cub::DeviceTransform`**: `fill`/`fill_n` ([PR #5805](https://github.com/NVIDIA/cccl/pull/5805)), `uninitialized_fill` ([PR #5813](https://github.com/NVIDIA/cccl/pull/5813)), `generate` ([PR #5807](https://github.com/NVIDIA/cccl/pull/5807)), `tabulate` ([PR #6012](https://github.com/NVIDIA/cccl/pull/6012)), `scatter_if` ([PR #5952](https://github.com/NVIDIA/cccl/pull/5952)), and non-trivial device-to-device `copy` ([PR #5954](https://github.com/NVIDIA/cccl/pull/5954)). In addition, `uninitialized_copy` now uses `copy` ([PR #5181](https://github.com/NVIDIA/cccl/pull/5181)), and `copy` ([PR #5491](https://github.com/NVIDIA/cccl/pull/5491)), `find` ([PR #6019](https://github.com/NVIDIA/cccl/pull/6019)), `mismatch` ([PR #6018](https://github.com/NVIDIA/cccl/pull/6018)) and `iter_swap` ([PR #5843](https://github.com/NVIDIA/cccl/pull/5843)) are rewritten. **To do:** port into `system/cuda/` only. The HIP disposition is "no change: performance-only", unless a commit also changes behavior. -- **Trivial copies use `cudaMemcpyDefault`** ([PR #7006](https://github.com/NVIDIA/cccl/pull/7006) via [PR #7134](https://github.com/NVIDIA/cccl/pull/7134)) — this makes copies correct when host and device pointers are swapped or the memory is managed. **To do:** switch `system/hip/detail/util.h` (lines 201 and 226) to `hipMemcpyDefault`, and port the new test as a HIP test. -- **`thrust::shuffle` bijection reworked to match libcu++'s Feistel bijection** ([PR #7172](https://github.com/NVIDIA/cccl/pull/7172) via [PR #7189](https://github.com/NVIDIA/cccl/pull/7189)) — the shuffled output sequence changes. **To do:** port `random_bijection.h` and the rewritten `shuffle.cu`, and update `test/test_shuffle.cpp`. -- **`device_delete` bypasses the allocator and supports polymorphic types; allocator and `device_[new|delete|free]` internals rewritten** ([PR #6134](https://github.com/NVIDIA/cccl/pull/6134), [PR #6136](https://github.com/NVIDIA/cccl/pull/6136), [PR #6198](https://github.com/NVIDIA/cccl/pull/6198), [PR #6140](https://github.com/NVIDIA/cccl/pull/6140)). **To do:** port; 7 of the allocator `.inl` files being deleted carry rocThrust edits (see §4). -- **`transform_iterator` traversal now comes from the base iterator's traversal, not its category** ([PR #5883](https://github.com/NVIDIA/cccl/pull/5883)). **To do:** port with its tests. -- **Internal uses of `thrust::pair`, `thrust::reverse_iterator`, `thrust::tabulate_output_iterator` and Thrust's duplicated math replaced by `cuda::std::` / `cuda::`** ([PR #6616](https://github.com/NVIDIA/cccl/pull/6616), [PR #5616](https://github.com/NVIDIA/cccl/pull/5616), [PR #6001](https://github.com/NVIDIA/cccl/pull/6001), [PR #6188](https://github.com/NVIDIA/cccl/pull/6188)). **To do:** translate to `_THRUST_STD::` / `_THRUST_LIBCXX::`. The non-libhipcxx fallback build needs care (see §4). -- **NVTX ranges disabled for `thrust::seq`** ([PR #6415](https://github.com/NVIDIA/cccl/pull/6415)) — adds `thrust/detail/nvtx_policy.h`. **To do:** rocThrust has no NVTX ranges; add the header for parity and drop the `_CCCL_NVTX_RANGE_SCOPE_IF` call sites, or tick N/A. -- **ABI inline-namespace spelling hardened against user macros** ([PR #6564](https://github.com/NVIDIA/cccl/pull/6564)). **To do:** apply the same `_CCCL_PP_CAT` construction to rocThrust's own `ROCTHRUST_VERSION` branch in `detail/config/namespace.h`. - -#### Deprecations -- **`THRUST_HOST_FUNCTION`, `THRUST_DEVICE_FUNCTION` and `THRUST_FUNCTION`** ([PR #5972](https://github.com/NVIDIA/cccl/pull/5972)) — marked deprecated in `system/cuda/config.h`, with internal uses replaced by `_CCCL_API`/`_CCCL_HOST_API`. **To do:** port to `system/cuda/`. Decide whether `THRUST_HIP_FUNCTION` in `system/hip/config.h` follows suit. -- **`_LIBCUDACXX_DEPRECATED` replaced by `CCCL_DEPRECATED`** ([PR #6024](https://github.com/NVIDIA/cccl/pull/6024)). **To do:** port. The macro comes from libhipcxx ≥ 3.2. - -#### Fixes -- **Uninitialized read in `uninitialized_copy_n`** ([PR #5811](https://github.com/NVIDIA/cccl/pull/5811)). **To do:** port, and check `system/hip/detail/uninitialized_copy.h` for the same pattern. -- **Missing stream synchronization in `cuda_cub::generate`** ([PR #5889](https://github.com/NVIDIA/cccl/pull/5889)). **To do:** port, and check `system/hip/detail/generate.h`. -- **`iterator_category_to_system` wrong for device iterator tags** ([PR #5880](https://github.com/NVIDIA/cccl/pull/5880)). **To do:** port with its tests. -- **CUDA memory resource no longer throws on free** ([PR #7002](https://github.com/NVIDIA/cccl/pull/7002) via [PR #7033](https://github.com/NVIDIA/cccl/pull/7033)) — avoids throwing from destructors and at process teardown. **To do:** apply the same change to `system/hip/memory_resource.h:79` ("HIP free failed"). -- **`thrust::ccosh` reformulated** ([PR #6200](https://github.com/NVIDIA/cccl/pull/6200)) — works around a GCC 14 segfault on Arm. **To do:** port. -- **`` included for clang-cuda** ([PR #6310](https://github.com/NVIDIA/cccl/pull/6310)), **`offset_iterator` tests** ([PR #6436](https://github.com/NVIDIA/cccl/pull/6436)), **`detect_wrong_difference` output iterator** ([PR #6450](https://github.com/NVIDIA/cccl/pull/6450)), and **OOM tolerated in the large `unique` test** ([PR #6304](https://github.com/NVIDIA/cccl/pull/6304)). **To do:** port. - -#### NVIDIA-only -- **UBLKCP in copy/scatter_if** ([PR #5954](https://github.com/NVIDIA/cccl/pull/5954), [PR #5952](https://github.com/NVIDIA/cccl/pull/5952)), **vectorized-transform storage alignment** ([PR #7163](https://github.com/NVIDIA/cccl/pull/7163)), **removal of `LoadIterator`** ([PR #5480](https://github.com/NVIDIA/cccl/pull/5480)), **trimmed CUDA core utilities** ([PR #5845](https://github.com/NVIDIA/cccl/pull/5845)), **nvhpc header wrappers moved to libcudacxx** ([PR #6167](https://github.com/NVIDIA/cccl/pull/6167)), **an NVHPC optimization workaround** ([PR #5416](https://github.com/NVIDIA/cccl/pull/5416)) and **device-lambda diagnostics** ([PR #6782](https://github.com/NVIDIA/cccl/pull/6782)). **To do:** port into `system/cuda/` for parity where the file exists; nothing is needed on the HIP side. - ---- - -## 2. New CMake options / feature macros - -None of the new upstream CMake options are Thrust-specific. `CCCL_ENABLE_*` and `CCCL_USE_LIBCXX` come from top-level CCCL CMake, and rocThrust has its own CMake, so they are N/A. All the new macros below are libcu++ 3.2 macros that rocThrust gets from libhipcxx ≥ 3.2 (the bundled 3.0.2 lacks them). - -| Option / macro | Default | Introduced in | Defined/read in | Notes / rocThrust disposition | -|----------------|---------|----------------|------------------|--------------------------------| -| `_CCCL_HOST_STD_LIB(X)` | — | v3.2.0 ([PR #6244](https://github.com/NVIDIA/cccl/pull/6244)) | libcu++; read in a Thrust header | Port as-is; provided by libhipcxx ≥ 3.2 | -| `_CCCL_BEGIN/END_NAMESPACE_CUDA[_STD]` | — | v3.2.0 ([PR #5538](https://github.com/NVIDIA/cccl/pull/5538)) | libcu++; Thrust iterator headers and tests | Translate to `_THRUST_STD_NAMESPACE_BEGIN/END` | -| `_CCCL_HOST_API`, `_CCCL_DEVICE_API`, `_CCCL_API` | — | v3.2.0 ([PR #5953](https://github.com/NVIDIA/cccl/pull/5953), [PR #5972](https://github.com/NVIDIA/cccl/pull/5972)) | libcu++; `system/cuda/` | Already used in `system/cuda/` (3 uses); keep them CUDA-side only | -| `_CCCL_TEMPLATE` / `_CCCL_REQUIRES` | — | v3.2.0 ([PR #6188](https://github.com/NVIDIA/cccl/pull/6188)) | libcu++ concept emulation | Port as-is; provided by libhipcxx ≥ 3.2 | -| `_CCCL_PP_CAT` | — | v3.2.0 ([PR #6564](https://github.com/NVIDIA/cccl/pull/6564)) | `detail/config/namespace.h` | Use rocThrust's `THRUST_PP_*` equivalent | -| `CCCL_DEPRECATED` | — | v3.2.0 ([PR #6024](https://github.com/NVIDIA/cccl/pull/6024)) | libcu++ | Port as-is; provided by libhipcxx ≥ 3.2 | -| `_CCCL_NVTX_RANGE_SCOPE_IF` | — | v3.2.0 ([PR #6415](https://github.com/NVIDIA/cccl/pull/6415)) | libcu++ NVTX | N/A on AMD (no NVTX in rocThrust) | -| `CCCL_DETAIL_KERNEL_ATTRIBUTES` | — | v3.2.0 ([PR #5843](https://github.com/NVIDIA/cccl/pull/5843)) | `system/cuda/detail/iter_swap.h` | CUDA-only | -| `__THRUST_{DEVICE,HOST}_SYSTEM_ALGORITH[_DETAIL]_HEADER_INCLUDE(f)` | — | v3.2.0 ([PR #6377](https://github.com/NVIDIA/cccl/pull/6377)) | `detail/config/{device,host}_system.h` | Replaces the ADL layer; must resolve to `system/hip/` for the HIP device system (see §4) | -| `THRUST_INCLUDING_ALGORITHMS_HEADER`, `_CCCL_TRAIT` (removed) | — | v3.2.0 ([PR #5764](https://github.com/NVIDIA/cccl/pull/5764), [PR #5466](https://github.com/NVIDIA/cccl/pull/5466)) | Thrust headers | Remove; check `system/hip/` for remaining uses | - ---- - -## 3. Test / benchmark coverage gaps - -### Tests - -| Feature / fix | Upstream test | rocThrust `testing/` / `test/` today | Action needed | -|---------------|---------------|--------------------------------------|---------------| -| `cuda::zip_iterator` / `transform_input_output_iterator` / `zip_transform_iterator` interop | `catch2_test_cuda_iterators.cu`, `zip_iterator.cu`, `transform_input_output_iterator.cu` | `testing/cuda_iterators.cu` + `test/test_libcxx_iterators.cpp` exist | Extend both, in Google Test | -| Iterator system/traversal propagation ([PR #5875](https://github.com/NVIDIA/cccl/pull/5875), [PR #5880](https://github.com/NVIDIA/cccl/pull/5880), [PR #5881](https://github.com/NVIDIA/cccl/pull/5881), [PR #5883](https://github.com/NVIDIA/cccl/pull/5883)) | new `catch2_test_iterator_traits.cu` | missing | Implement as a new Google Test, e.g. `test/test_iterator_traits.cpp`, plus a `testing/` counterpart | -| Trivial copy with `cudaMemcpyDefault` | new `cuda/trivial_copy_memcpy_default.cu` | missing | Add `testing/cuda/` copy and a HIP Google Test | -| `log2` in `xor_combine_engine_max` (replaces mpl math, [PR #5897](https://github.com/NVIDIA/cccl/pull/5897)) | new `xor_combine_engine_max.cu`; deletes `metaprogramming.cu` | `metaprogramming.cu` + `test_metaprogramming.cpp` exist | Add the new test to both suites; keep `metaprogramming` cases that still apply | -| OMP/TBB parallel scan | `omp/` scan tests ([PR #6704](https://github.com/NVIDIA/cccl/pull/6704)) | `testing/omp/` exists | Port | -| `device_delete` polymorphic / allocator bypass | `device_delete.cu` | both exist | Extend both | -| `reduce_by_key` | `reduce_by_key.cu` (+136 lines, [PR #6063](https://github.com/NVIDIA/cccl/pull/6063)) | both exist | Extend both | -| `shuffle` | `shuffle.cu` rewritten | both exist | Port and update the Google Test | -| Pair-, set-, sort- and iterator-test churn ([PR #6616](https://github.com/NVIDIA/cccl/pull/6616), [PR #5616](https://github.com/NVIDIA/cccl/pull/5616), [PR #4923](https://github.com/NVIDIA/cccl/pull/4923), [PR #6515](https://github.com/NVIDIA/cccl/pull/6515)) | ~60 `testing/*.cu` files | all exist | Port to `testing/`; mirror into `test/` where it changes behavior, not just spelling | - -### Catch2 migration -- `complex.cu` → `catch2_test_complex.cu` ([PR #6625](https://github.com/NVIDIA/cccl/pull/6625)). rocThrust keeps `testing/complex.cu` and `test/test_complex.cpp`, and adds any new cases with Google Test. - -### Benchmarks -- New upstream benchmarks that rocThrust lacks; port with Google Benchmark: - - `bench/generate/basic.cu` - - `bench/uninitialized_copy/basic.cu` - - `bench/transform/fib.cu` - - `bench/transform/if.cu` - - `bench/transform/if_stencil.cu` - - `bench/transform/zip_transform.cu` -- Renamed upstream: `bench/transform/basic.cu` → `bench/transform/babelstream.cu`. rocThrust still has `basic.cu`; rename it. -- Deleted upstream: none. -- Modified: about 40 benchmarks. The changes are mostly the `thrust::pair` → `cuda::std::pair` swap, `nvbench_helper` relocation, and SPDX headers ([PR #6441](https://github.com/NVIDIA/cccl/pull/6441)); there are no functional changes. - ---- - -## 4. Potentially problematic commits - -| Commit | Subject | Why risky | What to do | -|--------|---------|-----------|------------| -| [`88b95bb9a2c`](https://github.com/NVIDIA/cccl/commit/88b95bb9a2c) | Inline the Thrust ADL layer ([PR #6377](https://github.com/NVIDIA/cccl/pull/6377)) | Deletes all 43 `system/detail/adl/*.h`, which in rocThrust explicitly include `system/hip/detail/*`. 91 files are affected. | Make the new `__THRUST_DEVICE_SYSTEM_*_HEADER_INCLUDE` macros resolve to `system/hip` when the device system is HIP; build-test both the HIP and CUDA device systems | -| [`2f39a342b93`](https://github.com/NVIDIA/cccl/commit/2f39a342b93) | Refactor Thrust execution policies ([PR #5821](https://github.com/NVIDIA/cccl/pull/5821)) | Deletes `par.h`/`par_to_seq.h` for cuda/cpp/omp/tbb. rocThrust has AMD-only `system/hip/detail/par.h` and `par_to_seq.h`. | Port the same restructuring into `system/hip/` by hand | -| [`e73cc82956a`](https://github.com/NVIDIA/cccl/commit/e73cc82956a) | Move CPP, OMP and TBB exec policies to detail ([PR #6361](https://github.com/NVIDIA/cccl/pull/6361)) | Follow-up to #5821; touches `system/cuda/` | Check whether `system/hip/` needs the same move | -| [`fbb9479172c`](https://github.com/NVIDIA/cccl/commit/fbb9479172c), [`700f2a867a7`](https://github.com/NVIDIA/cccl/commit/700f2a867a7) | Allocator internals; `destroy_range`/`device_*` refactors ([PR #6136](https://github.com/NVIDIA/cccl/pull/6136), [PR #6134](https://github.com/NVIDIA/cccl/pull/6134)) | Deletes 11 `.inl` files; 7 of the allocator `.inl` files contain rocThrust `_THRUST_STD`/`::hip::` edits | Carry the rocThrust edits over into the merged headers | -| [`c22298179e0`](https://github.com/NVIDIA/cccl/commit/c22298179e0), [`c2f0b68245e`](https://github.com/NVIDIA/cccl/commit/c2f0b68245e), [`865e3d6429f`](https://github.com/NVIDIA/cccl/commit/865e3d6429f), [`e11761cc1b8`](https://github.com/NVIDIA/cccl/commit/e11761cc1b8) | OMP / TBB / seq header restructuring ([PR #6372](https://github.com/NVIDIA/cccl/pull/6372), [PR #6394](https://github.com/NVIDIA/cccl/pull/6394), [PR #6437](https://github.com/NVIDIA/cccl/pull/6437), [PR #6406](https://github.com/NVIDIA/cccl/pull/6406)) | About 250 files; most `.inl` files are deleted | Mostly mechanical; diff rocThrust's copies against v3.1.0 first to find local edits that must survive | -| [`91434d76ab3`](https://github.com/NVIDIA/cccl/commit/91434d76ab3) | Replace `thrust::pair` with `cuda::std::pair` ([PR #6616](https://github.com/NVIDIA/cccl/pull/6616)) | 115 files. In the fallback build (no libhipcxx) `_THRUST_STD::pair` is `std::pair`, whose device-side usability is unverified. | Translate to `_THRUST_STD::pair`; build-test the fallback configuration | -| [`31dd1d76e72`](https://github.com/NVIDIA/cccl/commit/31dd1d76e72), [`bcb2bcb106d`](https://github.com/NVIDIA/cccl/commit/bcb2bcb106d), [`4b10fd26255`](https://github.com/NVIDIA/cccl/commit/4b10fd26255), [`e6ad5079192`](https://github.com/NVIDIA/cccl/commit/e6ad5079192), [`5ff11d47308`](https://github.com/NVIDIA/cccl/commit/5ff11d47308) | clang-format, include cleanup, nested namespaces ([PR #6439](https://github.com/NVIDIA/cccl/pull/6439), [PR #6440](https://github.com/NVIDIA/cccl/pull/6440), [PR #6547](https://github.com/NVIDIA/cccl/pull/6547), [PR #6465](https://github.com/NVIDIA/cccl/pull/6465), [PR #5801](https://github.com/NVIDIA/cccl/pull/5801)) | 600+ files of whitespace and include churn; a high chance of conflicting context | Apply to the upstream-shared files; extend to `system/hip/` only if you want consistent formatting | -| [`b2a8d0e88f8`](https://github.com/NVIDIA/cccl/commit/b2a8d0e88f8), [`7b52284299d`](https://github.com/NVIDIA/cccl/commit/7b52284299d) | Plain `cuda::std::`; renamed namespace macros ([PR #5573](https://github.com/NVIDIA/cccl/pull/5573), [PR #5538](https://github.com/NVIDIA/cccl/pull/5538)) | rocThrust spells these `_THRUST_STD::` (1238 uses) | Translate rather than copy verbatim | -| [`3b6e4a6e911`](https://github.com/NVIDIA/cccl/commit/3b6e4a6e911), [`6d3ffc900fb`](https://github.com/NVIDIA/cccl/commit/6d3ffc900fb), [`fa13b90c53b`](https://github.com/NVIDIA/cccl/commit/fa13b90c53b), [`ff8a0d96b7f`](https://github.com/NVIDIA/cccl/commit/ff8a0d96b7f), [`bfb875c8f73`](https://github.com/NVIDIA/cccl/commit/bfb875c8f73) | `cuda::` iterator interop | The types don't exist in libhipcxx 3.0.2 | Port via `_THRUST_LIBCXX::`; requires the libhipcxx ≥ 3.2 bump | -| [`4eb027ce476`](https://github.com/NVIDIA/cccl/commit/4eb027ce476) + [`07e250154a8`](https://github.com/NVIDIA/cccl/commit/07e250154a8) | Drop `thrust::counting_iterator`, then revert it ([PR #5839](https://github.com/NVIDIA/cccl/pull/5839), [PR #5925](https://github.com/NVIDIA/cccl/pull/5925)) | Net zero across 83 files | Tick both N/A together | -| [`8b263079605`](https://github.com/NVIDIA/cccl/commit/8b263079605) | ABI namespace spelling ([PR #6564](https://github.com/NVIDIA/cccl/pull/6564)) | Changes the mangled inline-namespace name, and rocThrust has its own `ROCTHRUST_VERSION` branch | Apply to all three branches of `namespace.h` | -| [`2845628f12e`](https://github.com/NVIDIA/cccl/commit/2845628f12e), [`783ebe64a0e`](https://github.com/NVIDIA/cccl/commit/783ebe64a0e), [`d89402658b2`](https://github.com/NVIDIA/cccl/commit/d89402658b2), [`8a95f4c8051`](https://github.com/NVIDIA/cccl/commit/8a95f4c8051), [`065a6a742d6`](https://github.com/NVIDIA/cccl/commit/065a6a742d6), [`a8c74132b74`](https://github.com/NVIDIA/cccl/commit/a8c74132b74), [`344641b3b3c`](https://github.com/NVIDIA/cccl/commit/344641b3b3c) | Upstream CMake changes | rocThrust's CMake is independent of upstream's | Mostly N/A; check `testing/` and `examples/` CMake additions | - -### File renames / moves (build-break risk) -- `thrust/iterator/detail/iterator_traversal_tags.h` → `thrust/iterator/iterator_traversal_tags.h` ([PR #5833](https://github.com/NVIDIA/cccl/pull/5833)). Fix up includes in `system/hip/`. -- 110 upstream-deleted files still exist in rocThrust. They are the 43 `adl/*.h`, 11 allocator/`device_*` `.inl` files, `util/align.h`, `mpl/math.h`, `integer_math.h`, `complex/c99math.h`, `{algorithm,memory,numeric}_wrapper.h`, `cuda/detail/core/{load,make_load}_iterator.h`, `cuda/detail/{par,par_to_seq}.h`, `cuda/detail/internal/copy_*.h`, the OMP/TBB/sequential `.inl` files, and `generic/scan.inl`. Any `system/hip/` or rocThrust-only file that includes them must be updated. The `system/hip/detail/internal/copy_*.h` and `par*.h` counterparts need an explicit keep-or-delete decision. -- `testing/complex.cu` and `testing/metaprogramming.cu` are deleted upstream; keep them (see §3). - -### Public API / ABI changes -- The ABI inline namespace name changes ([PR #6564](https://github.com/NVIDIA/cccl/pull/6564)), and `THRUST_VERSION` becomes `300201`. -- Thrust 3.2 is written against libcu++ 3.2, while `libcxx.h` on the base branch still requires 3.0 and the bundled libhipcxx is 3.0.2. Raise the requirement to 3.2 alongside the libhipcxx bump. -- `THRUST_*_FUNCTION` macros are deprecated ([PR #5972](https://github.com/NVIDIA/cccl/pull/5972)). - ---- - -## Handoff - -- **Next step**: `rocthrust-cccl-sync-todo` for `v3.1.0..v3.2.1` on top of `users/matyas-streamhpc/hipccl/rocthrust_cccl31`, then `rocthrust-cccl-sync-resolve` and `rocthrust-cccl-sync-finalize`. -- **Decisions (2026-10-19)**: - - libhipcxx will be at least 3.2. Port the `cuda::` iterator interop and the libcu++ 3.2 macros as-is, translated to `_THRUST_LIBCXX::`/`_THRUST_STD::`, with no libhipcxx-3.0 fallback. Raise the required libhipcxx version in `libcxx.h` from 3.0 to 3.2. - - Compatibility over performance. Performance-only rewrites (the `DeviceTransform` routing, UBLKCP, the `copy`/`find`/`mismatch`/`iter_swap`/`replace` rewrites, vectorized-transform alignment) are ported into `system/cuda/` only. Their `system/hip/` disposition is "no change: performance-only". Behavior and correctness fixes still go into `system/hip/`. -- **Open questions**: - - Should the HIP backend's `par.h`, `par_to_seq.h` and `internal/copy_*.h` follow #5821's deletion, or stay as AMD-only? - - The `THRUST_HIP_FUNCTION` deprecation: follow #5972 or not? - - Is `std::pair` usable in device code in the fallback (no libhipcxx) build? This affects #6616. diff --git a/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu b/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu index 8a27ea332807..ad74dc43e060 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu @@ -20,10 +20,11 @@ #include #include -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include "include/host_device.h" // This example shows how to compute a bounding box diff --git a/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu b/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu index 2c294d13ebdf..4e119aceae66 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu @@ -25,9 +25,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif // This example demonstrates how to build a minimal custom // Thrust backend by intercepting for_each's dispatch. diff --git a/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu b/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu index cc72f8d3ed39..7586fb4f4acb 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu @@ -30,10 +30,6 @@ #include "include/host_device.h" -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // this example illustrates how to make repeated access to a range of values // examples: // repeated_range([0, 1, 2, 3], 1) -> [0, 1, 2, 3] diff --git a/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu b/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu index 484b0575d0d0..5c52a74fc20c 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu @@ -30,10 +30,6 @@ #include "include/host_device.h" -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // this example illustrates how to make strided access to a range of values // examples: // strided_range([0, 1, 2, 3, 4, 5, 6], 1) -> [0, 1, 2, 3, 4, 5, 6] diff --git a/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu b/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu index 780153c24ad9..991be54c4d3a 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu @@ -13,6 +13,9 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(mdspan) + #include #include @@ -23,16 +26,15 @@ int main() const int rows = 32; const int cols = 16; - // Create a 2D row-major multidimensional array of ints. + // Create a 2D multidimensional array of ints. thrust::universal_vector data(rows * cols, 42); - int* M = thrust::raw_pointer_cast(data.data()); - const int size = rows * cols; + _THRUST_STD::mdspan M(thrust::raw_pointer_cast(data.data()), rows, cols); // Create an iterator to the flat linear index space for the multidimensional array. - auto flat_idx = thrust::counting_iterator(0); + auto flat_idx = _THRUST_LIBCXX::counting_iterator(0); // Fill the array with pseudorandom inputs in parallel on the device. - thrust::tabulate(thrust::device, M, M + size, [] __host__ __device__(int flat) { + thrust::tabulate(thrust::device, M.data_handle(), M.data_handle() + M.size(), [] __host__ __device__(int flat) { thrust::default_random_engine rng; thrust::uniform_int_distribution dist(0, 3); rng.discard(flat); // Advance to the current element's position. @@ -43,11 +45,12 @@ int main() auto col_idx_begin = thrust::make_transform_iterator(flat_idx, [=] __host__ __device__(int flat) { return flat / rows; }); - auto col_idx_end = col_idx_begin + size; + auto col_idx_end = col_idx_begin + M.size(); // Create a transposed view of the multidimensional array. auto M_transposed = thrust::make_permutation_iterator( - M, thrust::make_transform_iterator(thrust::counting_iterator(0), [=] __host__ __device__(int flat) { + M.data_handle(), + thrust::make_transform_iterator(_THRUST_LIBCXX::counting_iterator(0), [=] __host__ __device__(int flat) { int i = flat / cols; int j = flat % cols; return i + j * rows; @@ -62,7 +65,7 @@ int main() thrust::for_each_n(thrust::seq, flat_idx, rows, [&](int i) { std::cout << "[ "; thrust::for_each_n(thrust::seq, flat_idx, cols, [&](int j) { - std::cout << std::setw(2) << M[i * cols + j] << " "; + std::cout << std::setw(2) << M(i, j) << " "; }); std::cout << "]\n"; }); diff --git a/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu b/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu index 39e023a6d3e9..d5901d7d3452 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu @@ -1,4 +1,3 @@ -<<<<<<< ours // Copyright (c) 2020-2026 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -29,26 +28,28 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(mdspan) + #include #include #include "include/host_device.h" -int main(void) +int main() { const int rows = 32; const int cols = 16; - // Create a 2D row-major multidimensional array of ints. + // Create a 2D multidimensional array of ints. thrust::universal_vector data(rows * cols, 42); - int* M = thrust::raw_pointer_cast(data.data()); - const int size = rows * cols; + _THRUST_STD::mdspan M(thrust::raw_pointer_cast(data.data()), rows, cols); // Create an iterator to the flat linear index space for the multidimensional array. - auto flat_idx = thrust::counting_iterator(0); + auto flat_idx = _THRUST_LIBCXX::counting_iterator(0); // Fill the array with pseudorandom inputs in parallel on the device. - thrust::tabulate(thrust::device, M, M + size, [] __host__ __device__(int flat) { + thrust::tabulate(thrust::device, M.data_handle(), M.data_handle() + M.size(), [] __host__ __device__(int flat) { thrust::default_random_engine rng; thrust::uniform_int_distribution dist(0, 3); rng.discard(flat); // Advance to the current element's position. @@ -59,20 +60,19 @@ int main(void) auto row_idx_begin = thrust::make_transform_iterator(flat_idx, [=] __host__ __device__(int flat) { return flat / cols; }); - auto row_idx_end = row_idx_begin + size; + auto row_idx_end = row_idx_begin + M.size(); // Sum each row, storing the result in a new vector. thrust::universal_vector sums(rows); - thrust::reduce_by_key(thrust::device, row_idx_begin, row_idx_end, M, thrust::make_discard_iterator(), sums.begin()); + thrust::reduce_by_key( + thrust::device, row_idx_begin, row_idx_end, M.data_handle(), thrust::make_discard_iterator(), sums.begin()); // Output the result. thrust::for_each_n(thrust::seq, flat_idx, rows, [&](int i) { std::cout << "[ "; thrust::for_each_n(thrust::seq, flat_idx, cols, [&](int j) { - std::cout << std::setw(2) << M[i * cols + j] << " "; + std::cout << std::setw(2) << M(i, j) << " "; }); std::cout << "] = " << sums[i] << "\n"; }); - - return 0; } diff --git a/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu b/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu index 6cd35c8b474a..ba5b707c7e30 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu @@ -30,10 +30,6 @@ #include "include/host_device.h" -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // this example illustrates how to tile a range multiple times // examples: // tiled_range([0, 1, 2, 3], 1) -> [0, 1, 2, 3] diff --git a/projects/hipccl/hipccl3/rocthrust/test/test_allocator_aware_policies.cpp b/projects/hipccl/hipccl3/rocthrust/test/test_allocator_aware_policies.cpp index 96ece7afada8..b0448c9a8ff4 100644 --- a/projects/hipccl/hipccl3/rocthrust/test/test_allocator_aware_policies.cpp +++ b/projects/hipccl/hipccl3/rocthrust/test/test_allocator_aware_policies.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp b/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp index 8bfa087b22b3..923436f1df90 100644 --- a/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp +++ b/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp @@ -971,11 +971,11 @@ TYPED_TEST(ComplexPairsTests, TestCompoundPlusOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() + rhs.real(), lhs.imag() + rhs.imag()); }, [=](std::complex& lhs, const U& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() + rhs, lhs.imag()); }, [=](thrust::complex& lhs, const thrust::complex& rhs) { @@ -995,11 +995,11 @@ TYPED_TEST(ComplexPairsTests, TestCompoundMinusOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() - rhs.real(), lhs.imag() - rhs.imag()); }, [=](std::complex& lhs, const U& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() - rhs, lhs.imag()); }, [=](thrust::complex& lhs, const thrust::complex& rhs) { @@ -1020,7 +1020,7 @@ TYPED_TEST(ComplexPairsTests, TestCompoundMultiplyOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { // (a + bi)(c + di) = ac + i(ad + bc) - bd - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; type a = static_cast(lhs.real()); type b = static_cast(lhs.imag()); @@ -1054,7 +1054,7 @@ TYPED_TEST(ComplexPairsTests, TestCompoundDivisionOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; // (a + bi) / (c + di) = ((ac + bd) + (bc -ad)i) / (c^2 + d^2) type a = static_cast(lhs.real()); diff --git a/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp b/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp index bf588f577f0e..28973201d101 100644 --- a/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp +++ b/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp @@ -44,13 +44,7 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(iterator) -#endif - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_LIBCXX_INCLUDE(iterator) TESTS_DEFINE(TypeTraitsTests, FullTestsParams); @@ -229,12 +223,10 @@ TEST(TypeTraitsTests, TestTriviallyRelocatable) static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple, char>>::value, ""); #endif // THRUST_COMPILER(GCC, >=, 7) -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable< _THRUST_STD::tuple>>, thrust::tuple<_THRUST_STD::pair>, int>>>::value, ""); -#endif static_assert(!thrust::is_trivially_relocatable>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); @@ -243,13 +235,9 @@ TEST(TypeTraitsTests, TestTriviallyRelocatable) // test propagation of relocatability through pair and tuple static_assert(thrust::is_trivially_relocatable::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); } @@ -317,7 +305,6 @@ struct thrust_make_zip_iterator } }; -#if _THRUST_HAS_DEVICE_SYSTEM_STD struct libcxx_make_counting_iterator { template @@ -344,7 +331,6 @@ struct libcxx_make_zip_iterator return _THRUST_LIBCXX::make_zip_iterator(_THRUST_STD::forward(args)...); } }; -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD template inline constexpr bool has_random_access_traversal = @@ -412,7 +398,6 @@ void check_vector_and_any_system_propagation() TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationAnySystem) { check_any_system_propagation(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); @@ -420,7 +405,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationAnySystem) check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD } TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectors) @@ -428,7 +412,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectors) check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); @@ -438,7 +421,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectors) check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD } TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem) @@ -446,7 +428,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectorsAndAnySyst check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); @@ -456,5 +437,4 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectorsAndAnySyst check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD } diff --git a/projects/hipccl/hipccl3/rocthrust/test/test_utils.hpp b/projects/hipccl/hipccl3/rocthrust/test/test_utils.hpp index fee7a8819b90..8d265d83c278 100644 --- a/projects/hipccl/hipccl3/rocthrust/test/test_utils.hpp +++ b/projects/hipccl/hipccl3/rocthrust/test/test_utils.hpp @@ -37,13 +37,7 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__algorithm/min.h) -#else -# include - -# include -#endif +#include _THRUST_STD_INCLUDE(__algorithm/min.h) #define TEST_EVENT_WAIT(e) test_event_wait(e) diff --git a/projects/hipccl/hipccl3/rocthrust/testing/allocator_aware_policies.cu b/projects/hipccl/hipccl3/rocthrust/testing/allocator_aware_policies.cu index b95803f9b751..c5b4aa42c899 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/allocator_aware_policies.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/allocator_aware_policies.cu @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu b/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu index 9a9806bfa14e..4417786787ff 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu @@ -223,11 +223,11 @@ void TestScalarEqualRangeSimple() DECLARE_VECTOR_UNITTEST(TestScalarEqualRangeSimple); template -thrust::pair +_THRUST_STD::pair equal_range(my_system& system, ForwardIterator first, ForwardIterator /*last*/, const LessThanComparable& /*value*/) { system.validate_dispatch(); - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestScalarEqualRangeDispatchExplicit() @@ -242,11 +242,11 @@ void TestScalarEqualRangeDispatchExplicit() DECLARE_UNITTEST(TestScalarEqualRangeDispatchExplicit); template -thrust::pair +_THRUST_STD::pair equal_range(my_tag, ForwardIterator first, ForwardIterator /*last*/, const LessThanComparable& /*value*/) { *first = 13; - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestScalarEqualRangeDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/copy.cu b/projects/hipccl/hipccl3/rocthrust/testing/copy.cu index ea7dbd2cd8d7..b504905fd509 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/copy.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/copy.cu @@ -34,10 +34,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - #if _CCCL_COMPILER(GCC, >=, 11) # define THRUST_DISABLE_BROKEN_GCC_VECTORIZER __attribute__((optimize("no-tree-vectorize"))) #else @@ -755,7 +751,6 @@ struct iterator_traits }; } // namespace std -# if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN template <> struct iterator_traits @@ -766,7 +761,6 @@ struct iterator_traits using difference_type = _THRUST_STD::ptrdiff_t; }; _THRUST_STD_NAMESPACE_END -# endif void TestCopyWithBigIndexesHelper(int magnitude) { diff --git a/projects/hipccl/hipccl3/rocthrust/testing/memory.cu b/projects/hipccl/hipccl3/rocthrust/testing/memory.cu index 212e64322125..8012c8af04a9 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/memory.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/memory.cu @@ -18,11 +18,12 @@ #include #include #include -#include #include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include #include @@ -80,12 +81,12 @@ struct my_old_temporary_allocation_system : public thrust::device_execution_poli {}; template -thrust::pair, std::ptrdiff_t> +_THRUST_STD::pair, std::ptrdiff_t> get_temporary_buffer(my_old_temporary_allocation_system, std::ptrdiff_t) { thrust::pointer const result(reinterpret_cast(4217)); - return thrust::make_pair(result, 314); + return _THRUST_STD::make_pair(result, 314); } template @@ -102,12 +103,12 @@ struct my_new_temporary_allocation_system : public thrust::device_execution_poli {}; template -thrust::pair, std::ptrdiff_t> +_THRUST_STD::pair, std::ptrdiff_t> get_temporary_buffer(my_new_temporary_allocation_system, std::ptrdiff_t) { thrust::pointer const result(reinterpret_cast(1742)); - return thrust::make_pair(result, 413); + return _THRUST_STD::make_pair(result, 413); } template @@ -184,7 +185,7 @@ void TestGetTemporaryBuffer() thrust::device_system_tag dev_tag; using pointer = thrust::pointer; - thrust::pair ptr_and_sz = thrust::get_temporary_buffer(dev_tag, n); + _THRUST_STD::pair ptr_and_sz = thrust::get_temporary_buffer(dev_tag, n); ASSERT_EQUAL(ptr_and_sz.second, n); @@ -254,15 +255,15 @@ void TestFreeDispatchExplicit() DECLARE_UNITTEST(TestFreeDispatchExplicit); template -thrust::pair, std::ptrdiff_t> +_THRUST_STD::pair, std::ptrdiff_t> get_temporary_buffer(my_memory_system& system, std::ptrdiff_t n) { system.validate_dispatch(); thrust::device_system_tag device_sys; - thrust::pair, std::ptrdiff_t> result = + _THRUST_STD::pair, std::ptrdiff_t> result = thrust::get_temporary_buffer(device_sys, n); - return thrust::make_pair(thrust::pointer(result.first.get()), result.second); + return _THRUST_STD::make_pair(thrust::pointer(result.first.get()), result.second); } // [NON-CCCL PARITY BEGIN] @@ -284,7 +285,7 @@ void TestGetTemporaryBufferDispatchExplicit() my_memory_system sys(0); using pointer = thrust::pointer; - thrust::pair ptr_and_sz = thrust::get_temporary_buffer(sys, n); + _THRUST_STD::pair ptr_and_sz = thrust::get_temporary_buffer(sys, n); ASSERT_EQUAL(ptr_and_sz.second, n); ASSERT_EQUAL(true, sys.is_valid()); @@ -333,7 +334,7 @@ void TestTemporaryBufferOldCustomization() { using system = my_old_namespace::my_old_temporary_allocation_system; using pointer = thrust::pointer; - using pointer_and_size = thrust::pair; + using pointer_and_size = _THRUST_STD::pair; system sys; @@ -353,7 +354,7 @@ void TestTemporaryBufferNewCustomization() { using system = my_new_namespace::my_new_temporary_allocation_system; using pointer = thrust::pointer; - using pointer_and_size = thrust::pair; + using pointer_and_size = _THRUST_STD::pair; system sys; diff --git a/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu index 2526fe27694e..42683990fd49 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu @@ -61,7 +61,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( my_system& system, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair merge_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestMergeByKeyDispatchExplicit() @@ -94,7 +94,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( my_tag, InputIterator1, InputIterator1, @@ -106,7 +106,7 @@ thrust::pair merge_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestMergeByKeyDispatchImplicit() @@ -239,7 +239,7 @@ void TestMergeByKeyToDiscardIterator(size_t n) const thrust::device_vector d_a_vals = h_a_vals; const thrust::device_vector d_b_vals = h_b_vals; - using discard_pair = thrust::pair, thrust::discard_iterator<>>; + using discard_pair = _THRUST_STD::pair, thrust::discard_iterator<>>; const discard_pair h_result = thrust::merge_by_key( h_a_keys.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu b/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu index 1a260fce2538..f7b260513507 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu @@ -80,10 +80,11 @@ void TestMinMaxElement(const size_t n) DECLARE_VARIABLE_UNITTEST(TestMinMaxElement); template -thrust::pair minmax_element(my_system& system, ForwardIterator first, ForwardIterator) +_THRUST_STD::pair +minmax_element(my_system& system, ForwardIterator first, ForwardIterator) { system.validate_dispatch(); - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMinMaxElementDispatchExplicit() @@ -98,10 +99,10 @@ void TestMinMaxElementDispatchExplicit() DECLARE_UNITTEST(TestMinMaxElementDispatchExplicit); template -thrust::pair minmax_element(my_tag, ForwardIterator first, ForwardIterator) +_THRUST_STD::pair minmax_element(my_tag, ForwardIterator first, ForwardIterator) { *first = 13; - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMinMaxElementDispatchImplicit() @@ -121,7 +122,7 @@ void TestMinMaxElementWithBigIndexesHelper(int magnitude) Iter end = begin + (1ll << magnitude); ASSERT_EQUAL(_THRUST_STD::distance(begin, end), 1ll << magnitude); - thrust::pair result = thrust::minmax_element(thrust::device, begin, end); + _THRUST_STD::pair result = thrust::minmax_element(thrust::device, begin, end); ASSERT_EQUAL(*result.first, 1); ASSERT_EQUAL(*result.second, (1ll << magnitude)); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu b/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu index 60bc69eab07a..567af422d6f3 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu @@ -41,11 +41,11 @@ void TestMismatchSimple() DECLARE_VECTOR_UNITTEST(TestMismatchSimple); template -thrust::pair +_THRUST_STD::pair mismatch(my_system& system, InputIterator1 first, InputIterator1, InputIterator2) { system.validate_dispatch(); - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMismatchDispatchExplicit() @@ -60,10 +60,10 @@ void TestMismatchDispatchExplicit() DECLARE_UNITTEST(TestMismatchDispatchExplicit); template -thrust::pair mismatch(my_tag, InputIterator1 first, InputIterator1, InputIterator2) +_THRUST_STD::pair mismatch(my_tag, InputIterator1 first, InputIterator1, InputIterator2) { *first = 13; - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMismatchDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu index 5dd6e6e2ce64..a5ae4e1a0c2e 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu @@ -15,18 +15,19 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -38,7 +39,7 @@ struct add_pairs // Need cast to undo integer promotion, decltype(char{} + char{}) == int using P1T1 = typename Pair1::first_type; using P1T2 = typename Pair1::second_type; - return thrust::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); + return _THRUST_STD::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); } // end operator() }; // end add_pairs @@ -47,7 +48,7 @@ struct TestPairReduce { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); @@ -60,7 +61,7 @@ struct TestPairReduce thrust::device_vector d_p2 = h_p2; thrust::device_vector

d_pairs = h_pairs; - P init = thrust::make_pair(T{13}, T{13}); + P init = _THRUST_STD::make_pair(T{13}, T{13}); // reduce on the host P h_result = thrust::reduce(h_pairs.begin(), h_pairs.end(), init, add_pairs()); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu index 662345b03608..863b7d583d96 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu @@ -15,19 +15,20 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -36,7 +37,7 @@ struct add_pairs template THRUST_HOST_DEVICE Pair1 operator()(const Pair1& x, const Pair2& y) { - return thrust::make_pair(x.first + y.first, x.second + y.second); + return _THRUST_STD::make_pair(x.first + y.first, x.second + y.second); } // end operator() }; // end add_pairs @@ -45,7 +46,7 @@ struct TestPairScan { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); @@ -60,7 +61,7 @@ struct TestPairScan thrust::device_vector

d_pairs = h_pairs; thrust::device_vector

d_output(n); - P init = thrust::make_pair(13, 13); + P init = _THRUST_STD::make_pair(13, 13); // scan with plus thrust::inclusive_scan(h_pairs.begin(), h_pairs.end(), h_output.begin(), add_pairs()); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu index ff4ed73f6d23..25d39cf7d2c6 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu @@ -15,18 +15,19 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -38,7 +39,7 @@ struct add_pairs // Need cast to undo integer promotion, decltype(char{} + char{}) == int using P1T1 = typename Pair1::first_type; using P1T2 = typename Pair1::second_type; - return thrust::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); + return _THRUST_STD::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); } // end operator() }; // end add_pairs @@ -47,7 +48,7 @@ struct TestPairScanByKey { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); @@ -63,7 +64,7 @@ struct TestPairScanByKey thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - P init = thrust::make_pair(T{13}, T{13}); + P init = _THRUST_STD::make_pair(T{13}, T{13}); // scan on the host thrust::exclusive_scan_by_key( diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu index 68277db6e760..da52e1f881d8 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu @@ -15,18 +15,19 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -35,7 +36,7 @@ struct TestPairStableSortByKey { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; // host arrays thrust::host_vector h_p1 = unittest::random_integers(n); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu index b9385b95c0cf..b686a9e964cd 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu @@ -15,17 +15,18 @@ * limitations under the License. */ -#include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -34,7 +35,7 @@ struct TestPairStableSort { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu index b486daac5fde..4e2f18d8f32b 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu @@ -16,10 +16,11 @@ */ #include -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include #if !_THRUST_HAS_DEVICE_SYSTEM_STD @@ -29,9 +30,9 @@ struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -43,7 +44,7 @@ struct add_pairs using T1 = typename _THRUST_STD::common_type::type; using T2 = typename _THRUST_STD::common_type::type; - return thrust::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); + return _THRUST_STD::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); } // end operator() }; // end add_pairs @@ -52,7 +53,7 @@ struct TestPairTransform { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/partition.cu b/projects/hipccl/hipccl3/rocthrust/testing/partition.cu index f8a2098736bc..86b614ed09a5 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/partition.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/partition.cu @@ -96,7 +96,7 @@ void TestPartitionCopySimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = + _THRUST_STD::pair ends = thrust::partition_copy(data.begin(), data.end(), true_results.begin(), false_results.begin(), is_even()); Vector true_ref(2, 2); @@ -122,7 +122,7 @@ void TestPartitionCopyStencilSimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = thrust::partition_copy( + _THRUST_STD::pair ends = thrust::partition_copy( data.begin(), data.end(), stencil.begin(), true_results.begin(), false_results.begin(), is_even()); Vector true_ref(2, 1); @@ -181,7 +181,7 @@ void TestStablePartitionCopySimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = + _THRUST_STD::pair ends = thrust::stable_partition_copy(data.begin(), data.end(), true_results.begin(), false_results.begin(), is_even()); Vector true_ref(2, 2); @@ -204,7 +204,7 @@ void TestStablePartitionCopyStencilSimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = thrust::stable_partition_copy( + _THRUST_STD::pair ends = thrust::stable_partition_copy( data.begin(), data.end(), stencil.begin(), true_results.begin(), false_results.begin(), _THRUST_STD::identity{}); Vector true_ref(2, 2); @@ -297,11 +297,11 @@ struct TestPartitionCopy thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::partition_copy( h_data.begin(), h_data.end(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::partition_copy( d_data.begin(), d_data.end(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -342,11 +342,11 @@ struct TestPartitionCopyStencil thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -387,11 +387,11 @@ struct TestStablePartitionCopyStencil thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -425,14 +425,14 @@ struct TestPartitionCopyToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -441,19 +441,19 @@ struct TestPartitionCopyToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::partition_copy( h_data.begin(), h_data.end(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::partition_copy( d_data.begin(), d_data.end(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -463,19 +463,19 @@ struct TestPartitionCopyToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -499,7 +499,7 @@ struct TestPartitionCopyStencilToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), @@ -507,7 +507,7 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), @@ -515,8 +515,8 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -525,19 +525,19 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -547,7 +547,7 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::partition_copy( h_data.begin(), h_data.end(), @@ -556,7 +556,7 @@ struct TestPartitionCopyStencilToDiscardIterator h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::partition_copy( d_data.begin(), d_data.end(), @@ -565,11 +565,11 @@ struct TestPartitionCopyStencilToDiscardIterator d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -649,11 +649,11 @@ struct TestStablePartitionCopy thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -683,14 +683,14 @@ struct TestStablePartitionCopyToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -699,19 +699,19 @@ struct TestStablePartitionCopyToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -721,19 +721,19 @@ struct TestStablePartitionCopyToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -758,7 +758,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), @@ -766,7 +766,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), @@ -774,8 +774,8 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -784,19 +784,19 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -806,7 +806,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), @@ -815,7 +815,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), @@ -824,11 +824,11 @@ struct TestStablePartitionCopyStencilToDiscardIterator d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -1013,11 +1013,11 @@ void TestPartitionStencilDispatchImplicit() DECLARE_UNITTEST(TestPartitionStencilDispatchImplicit); template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_system& system, InputIterator, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyDispatchExplicit() @@ -1036,7 +1036,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_system& system, InputIterator1, InputIterator1, @@ -1046,7 +1046,7 @@ thrust::pair partition_copy( Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyStencilDispatchExplicit() @@ -1061,11 +1061,11 @@ void TestPartitionCopyStencilDispatchExplicit() DECLARE_UNITTEST(TestPartitionCopyStencilDispatchExplicit); template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_tag, InputIterator first, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyDispatchImplicit() @@ -1088,7 +1088,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_tag, InputIterator1 first, InputIterator1, @@ -1098,7 +1098,7 @@ thrust::pair partition_copy( Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyStencilDispatchImplicit() @@ -1189,11 +1189,11 @@ void TestStablePartitionStencilDispatchImplicit() DECLARE_UNITTEST(TestStablePartitionStencilDispatchImplicit); template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_system& system, InputIterator, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyDispatchExplicit() @@ -1212,7 +1212,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_system& system, InputIterator1, InputIterator1, @@ -1222,7 +1222,7 @@ thrust::pair stable_partition_copy( Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyStencilDispatchExplicit() @@ -1237,11 +1237,11 @@ void TestStablePartitionCopyStencilDispatchExplicit() DECLARE_UNITTEST(TestStablePartitionCopyStencilDispatchExplicit); template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_tag, InputIterator first, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyDispatchImplicit() @@ -1264,7 +1264,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_tag, InputIterator1 first, InputIterator1, @@ -1274,7 +1274,7 @@ thrust::pair stable_partition_copy( Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyStencilDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu index 29963c4993d4..73a2fc039a30 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu @@ -53,7 +53,7 @@ void TestReduceByKeySimple() Vector keys; Vector values; - typename thrust::pair new_last; + typename _THRUST_STD::pair new_last; // basic test initialize_keys(keys); @@ -144,8 +144,8 @@ struct TestReduceByKey using DeviceKeyIterator = typename thrust::device_vector::iterator; using DeviceValIterator = typename thrust::device_vector::iterator; - using HostIteratorPair = typename thrust::pair; - using DeviceIteratorPair = typename thrust::pair; + using HostIteratorPair = typename _THRUST_STD::pair; + using DeviceIteratorPair = typename _THRUST_STD::pair; HostIteratorPair h_last = thrust::reduce_by_key(h_keys.begin(), h_keys.end(), h_vals.begin(), h_keys_output.begin(), h_vals_output.begin()); @@ -212,7 +212,7 @@ struct TestReduceByKeyToDiscardIterator VariableUnitTest TestReduceByKeyToDiscardIteratorInstance; template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( my_system& system, InputIterator1, InputIterator1, @@ -221,7 +221,7 @@ thrust::pair reduce_by_key( OutputIterator2 values_output) { system.validate_dispatch(); - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestReduceByKeyDispatchExplicit() @@ -236,11 +236,11 @@ void TestReduceByKeyDispatchExplicit() DECLARE_UNITTEST(TestReduceByKeyDispatchExplicit); template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( my_tag, InputIterator1, InputIterator1, InputIterator2, OutputIterator1 keys_output, OutputIterator2 values_output) { *keys_output = 13; - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestReduceByKeyDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu index 6e4715898a5f..9b5ad3c9f4d4 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu @@ -25,10 +25,6 @@ #include _THRUST_STD_INCLUDE(iterator) #include _THRUST_STD_INCLUDE(type_traits) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // ensure that we properly support thrust::reverse_iterator from _THRUST_STD void TestReverseIteratorTraits() { @@ -48,14 +44,12 @@ void TestReverseIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(_THRUST_STD::output_iterator); static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestReverseIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/scan.cu b/projects/hipccl/hipccl3/rocthrust/testing/scan.cu index 6967f26b9775..4ae51b6fbcbd 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/scan.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/scan.cu @@ -29,15 +29,9 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(functional) -#endif +#include _THRUST_LIBCXX_INCLUDE(functional) #include _THRUST_STD_INCLUDE(array) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - #include template @@ -613,7 +607,6 @@ struct iterator_traits }; } // namespace std -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN template <> struct iterator_traits @@ -624,7 +617,6 @@ struct iterator_traits using difference_type = _THRUST_STD::ptrdiff_t; }; _THRUST_STD_NAMESPACE_END -#endif void TestInclusiveScanWithBigIndexesHelper(int magnitude) { diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu index 1de71b603daf..ba901fa88d8b 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu @@ -28,7 +28,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( my_system& system, InputIterator1, InputIterator1, @@ -40,7 +40,7 @@ thrust::pair set_difference_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetDifferenceByKeyDispatchExplicit() @@ -61,7 +61,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( my_tag, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair set_difference_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetDifferenceByKeyDispatchImplicit() @@ -110,7 +110,7 @@ void TestSetDifferenceByKeySimple() Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_difference_by_key( + _THRUST_STD::pair end = thrust::set_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -161,9 +161,9 @@ void TestSetDifferenceByKey(const size_t n) thrust::device_vector d_result_keys(n); thrust::device_vector d_result_vals(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_keys.begin(), @@ -216,9 +216,9 @@ void TestSetDifferenceByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_key.begin(), @@ -280,9 +280,9 @@ void TestSetDifferenceByKeyMultiset(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu index 2ec484463d7d..4414bdc96084 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu @@ -34,7 +34,7 @@ void TestSetDifferenceByKeyDescendingSimple() Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_difference_by_key( + _THRUST_STD::pair end = thrust::set_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -74,9 +74,9 @@ void TestSetDifferenceByKeyDescending(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu index 3fcac17fb6cf..3f333a1bb2f9 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu @@ -27,7 +27,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( my_system& system, InputIterator1, InputIterator1, @@ -38,7 +38,7 @@ thrust::pair set_intersection_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetIntersectionByKeyDispatchExplicit() @@ -58,7 +58,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( my_tag, InputIterator1, InputIterator1, @@ -69,7 +69,7 @@ thrust::pair set_intersection_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetIntersectionByKeyDispatchImplicit() @@ -100,7 +100,7 @@ void TestSetIntersectionByKeySimple() Vector ref_key{0, 4}, ref_val{0, 0}; Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_intersection_by_key( + _THRUST_STD::pair end = thrust::set_intersection_by_key( a_key.begin(), a_key.end(), b_key.begin(), b_key.end(), a_val.begin(), result_key.begin(), result_val.begin()); ASSERT_EQUAL_QUIET(result_key.end(), end.first); @@ -142,9 +142,9 @@ void TestSetIntersectionByKey(const size_t n) thrust::device_vector d_result_keys(n); thrust::device_vector d_result_vals(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_keys.begin(), @@ -193,9 +193,9 @@ void TestSetIntersectionByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_key.begin(), @@ -253,9 +253,9 @@ void TestSetIntersectionByKeyMultiset(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu index a8c61ed7abdd..128c7ca109f9 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu @@ -33,7 +33,7 @@ void TestSetIntersectionByKeyDescendingSimple() Vector ref_key{4, 0}, ref_val{0, 0}; Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_intersection_by_key( + _THRUST_STD::pair end = thrust::set_intersection_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -70,9 +70,9 @@ void TestSetIntersectionByKeyDescending(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu index 4471ba6e382a..c9109f7fb668 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu @@ -28,7 +28,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( my_system& system, InputIterator1, InputIterator1, @@ -40,7 +40,7 @@ thrust::pair set_symmetric_difference_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetSymmetricDifferenceByKeyDispatchExplicit() @@ -61,7 +61,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( my_tag, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair set_symmetric_difference_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetSymmetricDifferenceByKeyDispatchImplicit() @@ -105,7 +105,7 @@ void TestSetSymmetricDifferenceByKeySimple() Vector ref_key{2, 3, 3, 6, 7}, ref_val{0, 1, 1, 0, 1}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_symmetric_difference_by_key( + _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -158,9 +158,9 @@ void TestSetSymmetricDifferenceByKey(const size_t n) thrust::device_vector d_result_keys(max_size); thrust::device_vector d_result_vals(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_keys.begin(), @@ -215,9 +215,9 @@ void TestSetSymmetricDifferenceByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_key.begin(), @@ -280,9 +280,9 @@ void TestSetSymmetricDifferenceByKeyMultiset(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu index eee7ebc99861..8f259c4076cb 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu @@ -33,7 +33,7 @@ void TestSetSymmetricDifferenceByKeyDescendingSimple() Vector ref_key{7, 6, 3, 3, 2}, ref_val{1, 0, 1, 1, 0}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_symmetric_difference_by_key( + _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -74,9 +74,9 @@ void TestSetSymmetricDifferenceByKeyDescending(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu index e1586782ef64..0a12738c6448 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu @@ -28,7 +28,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( my_system& system, InputIterator1, InputIterator1, @@ -40,7 +40,7 @@ thrust::pair set_union_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetUnionByKeyDispatchExplicit() @@ -61,7 +61,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( my_tag, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair set_union_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetUnionByKeyDispatchImplicit() @@ -105,7 +105,7 @@ void TestSetUnionByKeySimple() Vector ref_key{0, 2, 3, 3, 4}, ref_val{0, 0, 1, 1, 0}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_union_by_key( + _THRUST_STD::pair end = thrust::set_union_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -158,9 +158,9 @@ void TestSetUnionByKey(const size_t n) thrust::device_vector d_result_keys(max_size); thrust::device_vector d_result_vals(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_keys.begin(), @@ -215,9 +215,9 @@ void TestSetUnionByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_key.begin(), @@ -280,9 +280,9 @@ void TestSetUnionByKeyMultiset(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu index 90156aa73adf..7ebeb17e0b9c 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu @@ -33,7 +33,7 @@ void TestSetUnionByKeyDescendingSimple() Vector ref_key{4, 3, 3, 2, 0}, ref_val{0, 1, 1, 0, 0}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_union_by_key( + _THRUST_STD::pair end = thrust::set_union_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -74,9 +74,9 @@ void TestSetUnionByKeyDescending(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu index 4649d8134984..e7ca2f6c8104 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu @@ -34,10 +34,6 @@ #include _THRUST_STD_INCLUDE(type_traits) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - template struct host_write_op { @@ -124,14 +120,12 @@ void TestTabulateOutputIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); // FIXME(bgruber): all up to and including random access should be true -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); static_assert(!_THRUST_STD::input_iterator); static_assert(!_THRUST_STD::forward_iterator); static_assert(!_THRUST_STD::bidirectional_iterator); static_assert(!_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTabulateOutputIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform.cu index 34484688c373..899b799d2520 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform.cu @@ -19,10 +19,11 @@ #include #include #include -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include // There is a unfortunate miscompilation of the gcc-11 vectorizer leading to OOB writes @@ -410,9 +411,9 @@ DECLARE_VARIABLE_UNITTEST(TestTransformUnaryToDiscardIterator); struct repeat2 { template - THRUST_HOST_DEVICE thrust::pair operator()(T x) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(T x) { - return thrust::make_pair(x, x); + return _THRUST_STD::make_pair(x, x); } }; diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu index 3551fa8e6426..fac96ee32d97 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu @@ -25,11 +25,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif - // There is an unfortunate miscompilation of the gcc-12/gcc-13 vectorizer leading to OOB writes // Adding this attribute suffices that this miscompilation does not appear anymore #if THRUST_COMPILER(GCC, >=, 12) @@ -59,14 +54,12 @@ void TestTransformInputOutputIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTransformInputOutputIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu index 50baf05b18fe..0e5df73211ab 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu @@ -29,12 +29,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -# include -#endif - // ensure that we properly support thrust::transform_iterator from _THRUST_STD void TestTransformIteratorTraits() { @@ -54,14 +48,12 @@ void TestTransformIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTransformIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu index 271316abac77..4843c4ca26cc 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu @@ -27,11 +27,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif - // ensure that we properly support thrust::transform_output_iterator from _THRUST_STD void TestTransformOutputIteratorTraits() { @@ -52,7 +47,6 @@ void TestTransformOutputIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); // FIXME(bgruber): all up to and including random access should be true static_assert(!_THRUST_STD::input_iterator); @@ -60,7 +54,6 @@ void TestTransformOutputIteratorTraits() static_assert(!_THRUST_STD::bidirectional_iterator); static_assert(!_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTransformOutputIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu b/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu index 21492b3b49d1..d8aecb7b5f02 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -43,13 +42,7 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(iterator) -#endif - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_LIBCXX_INCLUDE(iterator) void TestIsContiguousIterator() { @@ -216,33 +209,27 @@ void TestTriviallyRelocatable() #if THRUST_COMPILER(GCC, >=, 7) static_assert(thrust::is_trivially_relocatable>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::complex>::value, ""); - static_assert(thrust::is_trivially_relocatable>>::value, ""); + static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>>::value, ""); static_assert(thrust::is_trivially_relocatable, char>>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple, char>>::value, ""); #endif // THRUST_COMPILER(GCC, >=, 7) -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable< - _THRUST_STD::tuple>>, + _THRUST_STD::tuple<_THRUST_STD::pair>>, thrust::tuple<_THRUST_STD::pair>, int>>>::value, ""); -#endif - static_assert(!thrust::is_trivially_relocatable>::value, ""); + static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(!thrust::is_trivially_relocatable>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); // test propagation of relocatability through pair and tuple static_assert(thrust::is_trivially_relocatable::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD - static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD + static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); }; DECLARE_UNITTEST(TestTriviallyRelocatable); @@ -313,7 +300,6 @@ struct thrust_make_zip_iterator } }; -#if _THRUST_HAS_DEVICE_SYSTEM_STD struct libcxx_make_counting_iterator { template @@ -340,7 +326,6 @@ struct libcxx_make_zip_iterator return _THRUST_LIBCXX::make_zip_iterator(_THRUST_STD::forward(args)...); } }; -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD template inline constexpr bool has_random_access_traversal = @@ -408,7 +393,6 @@ void check_vector_and_any_system_propagation() void TestIteratorSystemAndTraversalPropagationAnySystem() { check_any_system_propagation(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); @@ -416,7 +400,6 @@ void TestIteratorSystemAndTraversalPropagationAnySystem() check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD }; DECLARE_UNITTEST(TestIteratorSystemAndTraversalPropagationAnySystem); @@ -425,7 +408,6 @@ void TestIteratorSystemAndTraversalPropagationVectors() check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); @@ -435,7 +417,6 @@ void TestIteratorSystemAndTraversalPropagationVectors() check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD }; DECLARE_UNITTEST(TestIteratorSystemAndTraversalPropagationVectors); @@ -444,7 +425,6 @@ void TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem() check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); @@ -454,6 +434,5 @@ void TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem() check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD }; DECLARE_UNITTEST(TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu index f1cade3d18d1..a1cb86e436ad 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu @@ -40,11 +40,11 @@ struct index_to_value_t }; template -thrust::pair +_THRUST_STD::pair unique_by_key(my_system& system, ForwardIterator1 keys_first, ForwardIterator1, ForwardIterator2 values_first) { system.validate_dispatch(); - return thrust::make_pair(keys_first, values_first); + return _THRUST_STD::make_pair(keys_first, values_first); } void TestUniqueByKeyDispatchExplicit() @@ -59,11 +59,11 @@ void TestUniqueByKeyDispatchExplicit() DECLARE_UNITTEST(TestUniqueByKeyDispatchExplicit); template -thrust::pair +_THRUST_STD::pair unique_by_key(my_tag, ForwardIterator1 keys_first, ForwardIterator1, ForwardIterator2 values_first) { *keys_first = 13; - return thrust::make_pair(keys_first, values_first); + return _THRUST_STD::make_pair(keys_first, values_first); } void TestUniqueByKeyDispatchImplicit() @@ -78,7 +78,7 @@ void TestUniqueByKeyDispatchImplicit() DECLARE_UNITTEST(TestUniqueByKeyDispatchImplicit); template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( my_system& system, InputIterator1, InputIterator1, @@ -87,7 +87,7 @@ thrust::pair unique_by_key_copy( OutputIterator2 values_output) { system.validate_dispatch(); - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestUniqueByKeyCopyDispatchExplicit() @@ -102,11 +102,11 @@ void TestUniqueByKeyCopyDispatchExplicit() DECLARE_UNITTEST(TestUniqueByKeyCopyDispatchExplicit); template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( my_tag, InputIterator1, InputIterator1, InputIterator2, OutputIterator1 keys_output, OutputIterator2 values_output) { *keys_output = 13; - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestUniqueByKeyCopyDispatchImplicit() @@ -155,7 +155,7 @@ void TestUniqueByKeySimple() Vector keys; Vector values; - typename thrust::pair new_last; + typename _THRUST_STD::pair new_last; // basic test initialize_keys(keys); @@ -201,7 +201,7 @@ void TestUniqueCopyByKeySimple() Vector keys; Vector values; - typename thrust::pair new_last; + typename _THRUST_STD::pair new_last; // basic test initialize_keys(keys); @@ -262,8 +262,8 @@ struct TestUniqueByKey using DeviceKeyIterator = typename thrust::device_vector::iterator; using DeviceValIterator = typename thrust::device_vector::iterator; - using HostIteratorPair = typename thrust::pair; - using DeviceIteratorPair = typename thrust::pair; + using HostIteratorPair = typename _THRUST_STD::pair; + using DeviceIteratorPair = typename _THRUST_STD::pair; HostIteratorPair h_last = thrust::unique_by_key(h_keys.begin(), h_keys.end(), h_vals.begin()); DeviceIteratorPair d_last = thrust::unique_by_key(d_keys.begin(), d_keys.end(), d_vals.begin()); @@ -308,8 +308,8 @@ struct TestUniqueCopyByKey using DeviceKeyIterator = typename thrust::device_vector::iterator; using DeviceValIterator = typename thrust::device_vector::iterator; - using HostIteratorPair = typename thrust::pair; - using DeviceIteratorPair = typename thrust::pair; + using HostIteratorPair = typename _THRUST_STD::pair; + using DeviceIteratorPair = typename _THRUST_STD::pair; HostIteratorPair h_last = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), h_keys_output.begin(), h_vals_output.begin()); @@ -358,51 +358,51 @@ struct TestUniqueCopyByKeyToDiscardIterator size_t num_unique_keys = h_unique_keys.size(); // mask both outputs - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::unique_by_key_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), thrust::make_discard_iterator(), thrust::make_discard_iterator()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::unique_by_key_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::unique_by_key_copy( d_keys.begin(), d_keys.end(), d_vals.begin(), thrust::make_discard_iterator(), thrust::make_discard_iterator()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(num_unique_keys), thrust::make_discard_iterator(num_unique_keys)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = _THRUST_STD::make_pair( + thrust::make_discard_iterator(num_unique_keys), thrust::make_discard_iterator(num_unique_keys)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); // mask values output - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), h_keys_output.begin(), thrust::make_discard_iterator()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::unique_by_key_copy( d_keys.begin(), d_keys.end(), d_vals.begin(), d_keys_output.begin(), thrust::make_discard_iterator()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); ASSERT_EQUAL(h_keys_output, d_keys_output); ASSERT_EQUAL_QUIET(h_reference2, h_result2); ASSERT_EQUAL_QUIET(d_reference2, d_result2); // mask keys output - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), thrust::make_discard_iterator(), h_vals_output.begin()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::unique_by_key_copy( d_keys.begin(), d_keys.end(), d_vals.begin(), thrust::make_discard_iterator(), d_vals_output.begin()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(num_unique_keys), h_vals_output.begin() + num_unique_keys); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(num_unique_keys), h_vals_output.begin() + num_unique_keys); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(num_unique_keys), d_vals_output.begin() + num_unique_keys); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(num_unique_keys), d_vals_output.begin() + num_unique_keys); ASSERT_EQUAL(h_vals_output, d_vals_output); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -504,7 +504,7 @@ struct Entry void TestKeysWithoutEqualityOperator() { - using Key = thrust::pair; + using Key = _THRUST_STD::pair; const auto k1 = Key{1, {}}; const auto k2 = Key{2, {}}; diff --git a/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h b/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h index 8a2042fe37e9..97d2970d87b8 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h +++ b/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h @@ -28,14 +28,12 @@ #include #include +#include #include #include #include #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif #include "meta.h" #include "util.h" @@ -226,13 +224,11 @@ struct numeric_limits : numeric_limits {}; } // namespace std -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN template <> struct numeric_limits : numeric_limits {}; _THRUST_STD_NAMESPACE_END -#endif using NumericTypes = unittest::type_list< char, diff --git a/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu index 7b6527a703b8..072e9829b369 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu @@ -26,10 +26,6 @@ #include _THRUST_STD_INCLUDE(type_traits) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - using namespace unittest; // ensure that we properly support thrust::zip_iterator from _THRUST_STD @@ -52,18 +48,12 @@ void TestZipIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD // The fallback version of zip_iterator lacks these iterator concepts. static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestZipIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/addressof.h b/projects/hipccl/hipccl3/rocthrust/thrust/addressof.h index cf3e948596a4..cf5a692c9538 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/addressof.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/addressof.h @@ -15,11 +15,7 @@ # pragma system_header #endif // no system header -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__memory/addressof.h) -#else -# include -#endif +#include _THRUST_STD_INCLUDE(__memory/addressof.h) THRUST_NAMESPACE_BEGIN using _THRUST_STD::addressof; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/advance.h b/projects/hipccl/hipccl3/rocthrust/thrust/advance.h index 958dd2459abf..3fac8598a643 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/advance.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/advance.h @@ -30,7 +30,10 @@ # pragma system_header #endif // no system header -#include _THRUST_STD_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__iterator/iterator_traits.h) +#include _THRUST_STD_INCLUDE(__iterator/next.h) +#include _THRUST_STD_INCLUDE(__iterator/prev.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/allocate_unique.h b/projects/hipccl/hipccl3/rocthrust/thrust/allocate_unique.h index 5448a7f51f08..4344f1cf7d66 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/allocate_unique.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/allocate_unique.h @@ -16,12 +16,13 @@ #endif // no system header #include #include -#include #include #include -#include // for internal::remove_cvref_t -#include _THRUST_STD_INCLUDE(utility) +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cvref.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) +#include _THRUST_STD_INCLUDE(__utility/swap.h) THRUST_NAMESPACE_BEGIN @@ -65,7 +66,7 @@ struct allocator_delete final void operator()(pointer p) { - using traits = detail::allocator_traits<::internal::remove_cvref_t>; + using traits = detail::allocator_traits<_THRUST_STD::remove_cvref_t>; typename traits::allocator_type alloc_T(alloc_); if (nullptr != detail::pointer_traits::get(p)) @@ -141,7 +142,7 @@ struct array_allocator_delete final void operator()(pointer p) { - using traits = detail::allocator_traits<::internal::remove_cvref_t>; + using traits = detail::allocator_traits<_THRUST_STD::remove_cvref_t>; typename traits::allocator_type alloc_T(get_allocator()); if (nullptr != detail::pointer_traits::get(p)) { @@ -200,14 +201,14 @@ THRUST_HOST_DEVICE tagged_deleter make_tagged_deleter(Lambda&& //! Creates a \p std::unique_ptr holding a new object of type \p T, constructed with \p args, using \p alloc as the //! allocator. template -THRUST_HOST std::unique_ptr< - T, - allocator_delete< - T, - typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits::allocator_type>> +THRUST_HOST +std::unique_ptr>::template rebind_traits::allocator_type>> allocate_unique(Allocator const& alloc, Args&&... args) { - using traits = typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits; + using traits = typename detail::allocator_traits<_THRUST_STD::remove_cvref_t>::template rebind_traits; typename traits::allocator_type alloc_T(alloc); @@ -229,10 +230,10 @@ THRUST_HOST std::unique_ptr< T, uninitialized_allocator_delete< T, - typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits::allocator_type>> + typename detail::allocator_traits<_THRUST_STD::remove_cvref_t>::template rebind_traits::allocator_type>> uninitialized_allocate_unique(Allocator const& alloc) { - using traits = typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits; + using traits = typename detail::allocator_traits<_THRUST_STD::remove_cvref_t>::template rebind_traits; typename traits::allocator_type alloc_T(alloc); @@ -256,7 +257,7 @@ THRUST_HOST std::unique_ptr< Allocator>::type>::type>::template rebind_traits::allocator_type>> allocate_unique_n(Allocator const& alloc, Size n, Args&&... args) { - using traits = typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits; + using traits = typename detail::allocator_traits<_THRUST_STD::remove_cvref_t>::template rebind_traits; typename traits::allocator_type alloc_T(alloc); @@ -278,10 +279,10 @@ THRUST_HOST std::unique_ptr< T[], uninitialized_array_allocator_delete< T, - typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits::allocator_type>> + typename detail::allocator_traits<_THRUST_STD::remove_cvref_t>::template rebind_traits::allocator_type>> uninitialized_allocate_unique_n(Allocator const& alloc, Size n) { - using traits = typename detail::allocator_traits<::internal::remove_cvref_t>::template rebind_traits; + using traits = typename detail::allocator_traits<_THRUST_STD::remove_cvref_t>::template rebind_traits; typename traits::allocator_type alloc_T(alloc); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h b/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h index 38cd22ef6a51..1bc2a9289122 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -774,7 +775,7 @@ bool binary_search(ForwardIterator first, ForwardIterator last, const T& value, * \see \p binary_search */ template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -839,7 +840,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( * \see \p binary_search */ template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparable& value); /*! \p equal_range is a version of binary search: it attempts to find @@ -917,7 +918,7 @@ equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparabl * \see \p binary_search */ template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -994,7 +995,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( * \see \p binary_search */ template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, StrictWeakOrdering comp); /*! \addtogroup vectorized_binary_search Vectorized Searches diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/complex.h b/projects/hipccl/hipccl3/rocthrust/thrust/complex.h index 13584b345570..d11882c350b3 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/complex.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/complex.h @@ -35,16 +35,13 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__type_traits/common_type.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_reference.h) #if !THRUST_COMPILER(NVRTC) # include # include #endif // !THRUST_COMPILER(NVRTC) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - #define THRUST_STD_COMPLEX_REAL(z) \ reinterpret_cast::value_type(&)[2]>(z)[0] #define THRUST_STD_COMPLEX_IMAG(z) \ @@ -396,7 +393,7 @@ THRUST_HOST_DEVICE complex conj(const complex& z); * \param theta The phase of the returned \p complex in radians. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> polar(const T0& m, const T1& theta = T1()); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> polar(const T0& m, const T1& theta = T1()); /*! Returns the projection of a \p complex on the Riemann sphere. * For all finite \p complex it returns the argument. For \p complexs @@ -419,7 +416,7 @@ THRUST_HOST_DEVICE complex proj(const T& z); * \param y The second \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const complex& y); /*! Adds a scalar to a \p complex number. * @@ -430,7 +427,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const co * \param y The scalar. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const T1& y); /*! Adds a \p complex number to a scalar. * @@ -441,7 +438,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const co * \param y The \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const T0& x, const complex& y); /*! Subtracts two \p complex numbers. * @@ -452,7 +449,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const T0 * \param y The second \p complex (subtrahend). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const complex& y); /*! Subtracts a scalar from a \p complex number. * @@ -463,7 +460,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const co * \param y The scalar (subtrahend). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const T1& y); /*! Subtracts a \p complex number from a scalar. * @@ -474,7 +471,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const co * \param y The \p complex (subtrahend). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const T0& x, const complex& y); /*! Multiplies two \p complex numbers. * @@ -485,7 +482,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const T0 * \param y The second \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const complex& y); /*! Multiplies a \p complex number by a scalar. * @@ -493,7 +490,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const co * \param y The scalar. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const T1& y); /*! Multiplies a scalar by a \p complex number. * @@ -504,7 +501,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const co * \param y The \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const T0& x, const complex& y); /*! Divides two \p complex numbers. * @@ -515,7 +512,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const T0 * \param y The denomimator (divisor). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const complex& y); /*! Divides a \p complex number by a scalar. * @@ -526,7 +523,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const co * \param y The scalar denomimator (divisor). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const T1& y); /*! Divides a scalar by a \p complex number. * @@ -537,7 +534,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const co * \param y The complex denomimator (divisor). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const T0& x, const complex& y); /* --- Unary Arithmetic operators --- */ @@ -590,7 +587,7 @@ THRUST_HOST_DEVICE complex log10(const complex& z); * \param y The exponent. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const complex& y); /*! Returns a \p complex number raised to a scalar. * @@ -601,7 +598,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex< * \param y The exponent. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const T1& y); /*! Returns a scalar raised to a \p complex number. * @@ -612,7 +609,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex< * \param y The exponent. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const T0& x, const complex& y); /*! Returns the complex square root of a \p complex number. * diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/algorithm_wrapper.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/algorithm_wrapper.h deleted file mode 100644 index c732e106c1df..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/algorithm_wrapper.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2020 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header - -// When a compiler uses Thrust as part of its implementation of Standard C++ -// algorithms, a cycle of included files may result when Thrust code tries to -// use a standard algorithm. Having a macro that is defined only when Thrust -// is including an algorithms-related header gives the compiler a chance to -// detect and break the cycle of includes. - -#define THRUST_INCLUDING_ALGORITHMS_HEADER -#include -#undef THRUST_INCLUDING_ALGORITHMS_HEADER diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/alignment.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/alignment.h index ddcbd4bf0ece..bef96bd91f51 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/alignment.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/alignment.h @@ -29,14 +29,9 @@ # pragma system_header #endif // no system header +#include _THRUST_LIBCXX_INCLUDE(__cmath/ceil_div.h) +#include _THRUST_STD_INCLUDE(__type_traits/alignment_of.h) #include _THRUST_STD_INCLUDE(cstddef) // For `std::size_t` and `std::max_align_t`. -#include _THRUST_STD_INCLUDE(type_traits) // For `std::alignment_of`. - -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(cmath) -#elif _THRUST_USE_ROCPRIM -# include -#endif THRUST_NAMESPACE_BEGIN namespace detail @@ -80,13 +75,7 @@ THRUST_HOST_DEVICE T aligned_reinterpret_cast(U u) THRUST_HOST_DEVICE inline _THRUST_STD::size_t aligned_storage_size(_THRUST_STD::size_t n, _THRUST_STD::size_t align) { -#if _THRUST_HAS_DEVICE_SYSTEM_STD return _THRUST_LIBCXX::ceil_div(n, align) * align; -#elif _THRUST_USE_ROCPRIM - return ::rocprim::detail::ceiling_div(n, align) * align; -#else - return (n / align + (n % align > 0 ? 1 : 0)) * align; -#endif } } // end namespace detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/allocator_traits.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/allocator_traits.h index 4a6ae0d54094..8ea0ab2f3534 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/allocator_traits.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/allocator_traits.h @@ -31,7 +31,6 @@ #endif // no system header #include -#include #include #include #include @@ -39,8 +38,14 @@ #include #include +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) +#include _THRUST_STD_INCLUDE(__type_traits/add_lvalue_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_empty.h) +#include _THRUST_STD_INCLUDE(__type_traits/make_unsigned.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) +#include _THRUST_STD_INCLUDE(__type_traits/void_t.h) #include _THRUST_STD_INCLUDE(limits) -#include _THRUST_STD_INCLUDE(type_traits) #include @@ -401,7 +406,7 @@ struct allocator_traits using size_type = typename eval_if::value, allocator_traits_detail::nested_size_type, - ::internal::make_unsigned>::type; + _THRUST_STD::make_unsigned>::type; using propagate_on_container_copy_assignment = typename eval_if::value, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h index 1113e18912e2..015135fafbf6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h @@ -26,21 +26,20 @@ # pragma system_header #endif // no system header -#include #include #include #include -#include #include -#include #include #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__iterator/distance.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_trivially_copy_constructible.h) THRUST_NAMESPACE_BEGIN namespace detail diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h index 5e9d9714fec6..5c86d96bd962 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h @@ -28,13 +28,10 @@ #include #include -#include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) THRUST_NAMESPACE_BEGIN namespace detail diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h index 9f8714cfc84c..62dcabe7c669 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h @@ -27,15 +27,12 @@ #endif // no system header #include -#include #include #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) THRUST_NAMESPACE_BEGIN namespace detail diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h index a7b9b5308bd5..4b445d54ab78 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h @@ -33,9 +33,9 @@ #include #include #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) #include _THRUST_STD_INCLUDE(cassert) #if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA @@ -118,7 +118,7 @@ class temporary_allocator : public thrust::detail::tagged_allocator; + using pointer_and_size = _THRUST_STD::pair; }; // end temporary_allocator } // namespace detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h index 3ce6a09b104a..e959f74c17f3 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h @@ -32,9 +32,7 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/is_trivially_default_constructible.h) THRUST_NAMESPACE_BEGIN namespace detail diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator_aware_execution_policy.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator_aware_execution_policy.h index 66e7e9a21e57..316980fa356c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator_aware_execution_policy.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator_aware_execution_policy.h @@ -28,11 +28,9 @@ #include #include -#include _THRUST_STD_INCLUDE(type_traits) - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_reference.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl index 964533dc2c59..382dd507e4f7 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl @@ -123,7 +123,7 @@ THRUST_HOST_DEVICE bool binary_search( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -136,7 +136,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -346,7 +346,7 @@ bool binary_search(ForwardIterator first, ForwardIterator last, const T& value, } template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparable& value) { using thrust::system::detail::generic::select_system; @@ -359,7 +359,7 @@ equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparabl } template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, StrictWeakOrdering comp) { using thrust::system::detail::generic::select_system; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h index a3e346b37923..b011e9db20f1 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h @@ -24,79 +24,84 @@ #include #include _THRUST_STD_INCLUDE(cfloat) -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__type_traits/common_type.h) THRUST_NAMESPACE_BEGIN /* --- Binary Arithmetic Operators --- */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() + y.real(), x.imag() + y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() + y, x.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x + y.real(), y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() - y.real(), x.imag() - y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() - y, x.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x - y.real(), -y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() * y.real() - x.imag() * y.imag(), x.real() * y.imag() + x.imag() * y.real()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() * y, x.imag() * y); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x * y.real(), x * y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; T s = _THRUST_STD::abs(y.real()) + _THRUST_STD::abs(y.imag()); T oos = T(1.0) / s; @@ -115,16 +120,16 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const co } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() / y, x.imag() / y); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x) / y; } @@ -199,9 +204,9 @@ THRUST_HOST_DEVICE inline double norm(const complex& z) } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> polar(const T0& m, const T1& theta) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> polar(const T0& m, const T1& theta) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(m * _THRUST_STD::cos(theta), m * _THRUST_STD::sin(theta)); } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h index 9f56d1c723db..92289af389d6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h @@ -53,7 +53,16 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h index eb25b6c26f34..b8b7222dc1f2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h @@ -53,7 +53,16 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h index 47bc17a9658a..fd06e168949e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h @@ -53,7 +53,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h index c889ae3b9cab..bf70c8f988fe 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h @@ -54,7 +54,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h index 5eca70b07d44..2486d1c0de84 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h @@ -55,7 +55,8 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h index 71c19a3a751f..17ed0217f6e1 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h @@ -55,7 +55,8 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h index a02ac302826b..ce5f3430710f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h @@ -51,7 +51,10 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h index 1444dd5a6ab8..0e14e0bce28c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h @@ -51,7 +51,10 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h index 6155f4a4c577..5f80cd28c2a2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h @@ -25,14 +25,16 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) +#include _THRUST_STD_INCLUDE(__type_traits/common_type.h) THRUST_NAMESPACE_BEGIN template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return exp(log(complex(x)) * complex(y)); } @@ -68,16 +70,16 @@ THRUST_HOST_DEVICE inline complex pow(const complex& x, const comp #endif template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return exp(log(complex(x)) * T(y)); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return exp(_THRUST_STD::log(T(x)) * complex(y)); } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h index 0f3afdb40140..6b3626a9574d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h @@ -22,7 +22,8 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h index a0af5d0b5c71..0656a5b648b4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h @@ -53,7 +53,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h index 033d4217dc20..8ad17db03749 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h @@ -54,7 +54,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h index 646c45c72e53..dc745c1a9816 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h @@ -53,7 +53,13 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h index 0e6c7efa96f7..ac277fdf771e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h @@ -53,7 +53,13 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h index 975091459a9a..a48b1a50a597 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h @@ -92,7 +92,15 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isfinite.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h index 08e288451748..2cc7d2ebde86 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h @@ -57,7 +57,14 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isfinite.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.h index 04174affcc69..65fb539fda67 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.h @@ -29,11 +29,10 @@ #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif -#include _THRUST_STD_INCLUDE(utility) +#include _THRUST_STD_INCLUDE(__utility/move.h) +#include _THRUST_STD_INCLUDE(__utility/swap.h) + #include _THRUST_STD_INCLUDE(__host_stdlib/stdexcept) THRUST_NAMESPACE_BEGIN @@ -117,11 +116,7 @@ class contiguous_storage THRUST_EXEC_CHECK_DISABLE THRUST_HOST_DEVICE void swap(contiguous_storage& other) { -#if _THRUST_HAS_DEVICE_SYSTEM_STD using _THRUST_STD::swap; -#else - using thrust::swap; -#endif swap(m_begin, other.m_begin); swap(m_size, other.m_size); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.inl index 0e068fe9e11a..89468795341a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/contiguous_storage.inl @@ -33,7 +33,8 @@ #include #include -#include _THRUST_STD_INCLUDE(utility) +#include _THRUST_STD_INCLUDE(__utility/move.h) +#include _THRUST_STD_INCLUDE(__utility/swap.h) #include diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h index 3d41533ae94d..236c122f4ddf 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h @@ -28,21 +28,18 @@ #include #include -#include #include #include -#include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_LIBCXX_INCLUDE(__cmath/ceil_div.h) +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN namespace detail { template class BaseSystem> -THRUST_HOST thrust::pair +THRUST_HOST _THRUST_STD::pair get_temporary_buffer(thrust::detail::execute_with_allocator& system, std::ptrdiff_t n) { using naked_allocator = _THRUST_STD::remove_reference_t; @@ -53,12 +50,12 @@ get_temporary_buffer(thrust::detail::execute_with_allocator(_THRUST_LIBCXX::ceil_div(sizeof(T) * n, sizeof(value_type))); void_pointer ptr = alloc_traits::allocate(system.get_allocator(), num_elements); // Return the pointer and the number of elements of type T allocated. - return thrust::make_pair(thrust::reinterpret_pointer_cast(ptr), n); + return _THRUST_STD::make_pair(thrust::reinterpret_pointer_cast(ptr), n); } template class BaseSystem> @@ -72,7 +69,7 @@ THRUST_HOST void return_temporary_buffer( using value_type = typename alloc_traits::value_type; using T = typename thrust::detail::pointer_traits::element_type; - size_type num_elements = divide_ri(sizeof(T) * n, sizeof(value_type)); + size_type num_elements = _THRUST_LIBCXX::ceil_div(sizeof(T) * n, sizeof(value_type)); pointer to_ptr = thrust::reinterpret_pointer_cast(p); alloc_traits::deallocate(system.get_allocator(), to_ptr, num_elements); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl index 443a35cb454f..251d98261e2d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl @@ -90,7 +90,7 @@ THRUST_HOST_DEVICE ForwardIterator max_element( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last) { using thrust::system::detail::generic::minmax_element; @@ -99,7 +99,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -158,7 +158,7 @@ ForwardIterator max_element(ForwardIterator first, ForwardIterator last, BinaryP } // end max_element() template -thrust::pair minmax_element(ForwardIterator first, ForwardIterator last) +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last) { using thrust::system::detail::generic::select_system; @@ -170,7 +170,7 @@ thrust::pair minmax_element(ForwardIterator fi } // end minmax_element() template -thrust::pair +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last, BinaryPredicate comp) { using thrust::system::detail::generic::select_system; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/actor.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/actor.h index ada3e3dad189..b1e56795fc9c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/actor.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/actor.h @@ -36,15 +36,12 @@ # pragma system_header #endif // no system header #include -#include // for internal::decay_t #include -#include _THRUST_STD_INCLUDE(type_traits) -#include _THRUST_STD_INCLUDE(utility) - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/decay.h) +#include _THRUST_STD_INCLUDE(__type_traits/integral_constant.h) +#include _THRUST_STD_INCLUDE(__utility/declval.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) THRUST_NAMESPACE_BEGIN namespace detail::functional @@ -81,7 +78,6 @@ struct is_actor> : _THRUST_STD::true_type {}; // a node selecting and returning one of the arguments to the entire expression template -#if _THRUST_HAS_DEVICE_SYSTEM_STD template struct argument { @@ -92,17 +88,6 @@ struct argument return thrust::get(thrust::tuple{THRUST_FWD(args)...}); } }; -#else -template -struct argument -{ - template - THRUST_HOST_DEVICE auto eval(Ts&&... args) const -> decltype(::std::get(::std::forward_as_tuple(args...))) - { - return ::std::get(::std::forward_as_tuple(args...)); - } -}; -#endif template struct placeholder @@ -197,7 +182,7 @@ struct value }; template -THRUST_HOST_DEVICE auto make_actor(T&& x) -> actor>> +THRUST_HOST_DEVICE auto make_actor(T&& x) -> actor>> { return {{THRUST_FWD(x)}}; } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/operators.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/operators.h index 4d664a97ad52..7a4f958286d3 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/operators.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/functional/operators.h @@ -37,7 +37,8 @@ #include #include -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__functional/operations.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) THRUST_NAMESPACE_BEGIN namespace detail::functional diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h deleted file mode 100644 index 8e088f018e47..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2008-2013 NVIDIA Corporation - * Modifications Copyright© 2023-2026 Advanced Micro Devices, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header -#include - -#include _THRUST_STD_INCLUDE(bit) -#include _THRUST_STD_INCLUDE(__type_traits/make_unsigned.h) -#include _THRUST_STD_INCLUDE(limits) -#include _THRUST_STD_INCLUDE(type_traits) - -THRUST_NAMESPACE_BEGIN -namespace detail -{ - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE bool is_power_of_2(Integer x) -{ - return 0 == (x & (x - 1)); -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE typename std::enable_if::value, bool>::type is_negative(T x) -{ - return x < 0; -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE typename std::enable_if::value, bool>::type is_negative(T) -{ - return false; -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE bool is_odd(Integer x) -{ - return 1 & x; -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE Integer log2(Integer x) -{ - Integer num_bits = 8 * sizeof(Integer); - Integer num_bits_minus_one = num_bits - 1; - - return num_bits_minus_one - _THRUST_STD::countl_zero(::cuda::std::__to_unsigned_like(x)); -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE Integer log2_ri(Integer x) -{ - Integer result = log2(x); - - // This is where we round up to the nearest log. - if (!is_power_of_2(x)) - { - ++result; - } - - return result; -} - -// x/y rounding towards +infinity for integers -// Used to determine # of blocks/warps etc. -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE - // FIXME: Should use common_type. - auto - divide_ri(Integer0 const x, Integer1 const y) THRUST_DECLTYPE_RETURNS((x + (y - 1)) / y) - - // x/y rounding towards zero for integers. - // Used to determine # of blocks/warps etc. - template - THRUST_HOST_DEVICE THRUST_FORCEINLINE auto divide_rz(Integer0 const x, Integer1 const y) - THRUST_DECLTYPE_RETURNS(x / y) - - // Round x towards infinity to the next multiple of y. - template - THRUST_HOST_DEVICE THRUST_FORCEINLINE auto round_i(Integer0 const x, Integer1 const y) - THRUST_DECLTYPE_RETURNS(y* divide_ri(x, y)) - - // Round x towards 0 to the next multiple of y. - template - THRUST_HOST_DEVICE THRUST_FORCEINLINE auto round_z(Integer0 const x, Integer1 const y) - THRUST_DECLTYPE_RETURNS(y* divide_rz(x, y)) - -} // namespace detail - -THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h index 1cb23dee05eb..584f31956923 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h @@ -31,9 +31,6 @@ # pragma system_header #endif // no system header -#include -#include -#include // for ::new #include #include #include @@ -41,14 +38,20 @@ #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(__iterator/discard_iterator.h) -# include _THRUST_LIBCXX_INCLUDE(__iterator/tabulate_output_iterator.h) -# include _THRUST_LIBCXX_INCLUDE(__iterator/transform_input_output_iterator.h) -# include _THRUST_STD_INCLUDE(__new/device_new.h) -#endif - -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_LIBCXX_INCLUDE(__functional/address_stability.h) +#include _THRUST_LIBCXX_INCLUDE(__iterator/discard_iterator.h) +#include _THRUST_LIBCXX_INCLUDE(__iterator/tabulate_output_iterator.h) +#include _THRUST_LIBCXX_INCLUDE(__iterator/transform_input_output_iterator.h) +#include _THRUST_LIBCXX_INCLUDE(__iterator/transform_output_iterator.h) +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) // for ::new +#include _THRUST_STD_INCLUDE(__new/device_new.h) +#include _THRUST_STD_INCLUDE(__tuple_dir/get.h) +#include _THRUST_STD_INCLUDE(__tuple_dir/tuple_element.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_const.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) THRUST_NAMESPACE_BEGIN @@ -315,12 +318,7 @@ struct compare_first } // end namespace detail THRUST_NAMESPACE_END -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_LIBCXX_NAMESPACE_BEGIN -#else -namespace internal -{ -#endif template struct proclaims_copyable_arguments> : proclaims_copyable_arguments @@ -335,8 +333,4 @@ template struct proclaims_copyable_arguments> : proclaims_copyable_arguments {}; -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_LIBCXX_NAMESPACE_END -#else -} // namespace internal -#endif diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/libcxx_wrapper/std/__memory/construct_at.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/libcxx_wrapper/std/__memory/construct_at.h index 67f816cb37a2..d2de771c634b 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/libcxx_wrapper/std/__memory/construct_at.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/libcxx_wrapper/std/__memory/construct_at.h @@ -22,9 +22,9 @@ # include # include # include -# include # include +# include # include # include #endif diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_algorithms.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_algorithms.h index ddfbbdec2e71..97221ddd67fd 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_algorithms.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_algorithms.h @@ -19,20 +19,13 @@ # pragma system_header #endif // no system header #include -#include #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__memory/addressof.h) -#endif - -#include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - -#include +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) +#include _THRUST_STD_INCLUDE(__memory/addressof.h) +#include _THRUST_STD_INCLUDE(__new/device_new.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cvref.h) #include diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_wrapper.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_wrapper.h deleted file mode 100644 index 831038a98e74..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/memory_wrapper.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header - -// When a compiler uses Thrust as part of its implementation of Standard C++ -// algorithms, a cycle of included files may result when Thrust code tries to -// use a standard algorithm. Having a macro that is defined only when Thrust -// is including an algorithms-related header gives the compiler a chance to -// detect and break the cycle of includes. ( declares several standard -// algorithms, including all of the uninitialized_* algorithms. "_ALGORITHMS_" -// in the macro name is meant generically, not as a specific reference to -// the header .) - -#define THRUST_INCLUDING_ALGORITHMS_HEADER -#include -#undef THRUST_INCLUDING_ALGORITHMS_HEADER diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl index 2d6507a21d6c..36db57e93421 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl @@ -89,7 +89,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -122,7 +122,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -194,7 +194,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -240,7 +240,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl index e531c55dc78f..f97bad718279 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl @@ -48,7 +48,7 @@ THRUST_NAMESPACE_BEGIN THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch(const thrust::detail::execution_policy_base& exec, InputIterator1 first1, InputIterator1 last1, @@ -60,7 +60,7 @@ mismatch(const thrust::detail::execution_policy_base& exec, THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( const thrust::detail::execution_policy_base& exec, InputIterator1 first1, InputIterator1 last1, @@ -72,7 +72,7 @@ THRUST_HOST_DEVICE thrust::pair mismatch( } // end mismatch() template -thrust::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) +_THRUST_STD::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) { using thrust::system::detail::generic::select_system; @@ -86,7 +86,7 @@ thrust::pair mismatch(InputIterator1 first1, Inp } // end mismatch() template -thrust::pair +_THRUST_STD::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred) { using thrust::system::detail::generic::select_system; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/numeric_wrapper.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/numeric_wrapper.h deleted file mode 100644 index 24a5202b5204..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/numeric_wrapper.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2021 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header - -// When a compiler uses Thrust as part of its implementation of Standard C++ -// algorithms, a cycle of included files may result when Thrust code tries to -// use a standard algorithm. Having a macro that is defined only when Thrust -// is including an algorithms-related header gives the compiler a chance to -// detect and break the cycle of includes. - -#define THRUST_INCLUDING_ALGORITHMS_HEADER -#include -#undef THRUST_INCLUDING_ALGORITHMS_HEADER diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl deleted file mode 100644 index 9faa2e2429aa..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright 2008-2021 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// TODO(libhipcxx): remove this file once libhipcxx gets ready - -#include - -#include -#include - -THRUST_NAMESPACE_BEGIN - -template - THRUST_HOST_DEVICE - pair - ::pair(void) - :first(),second() -{ - ; -} // end pair::pair() - - -template - THRUST_HOST_DEVICE - pair - ::pair(const T1 &x, const T2 &y) - :first(x),second(y) -{ - ; -} // end pair::pair() - - -template - template - THRUST_HOST_DEVICE - pair - ::pair(const pair &p) - :first(p.first),second(p.second) -{ - ; -} // end pair::pair() - - -template - template - THRUST_HOST_DEVICE - pair - ::pair(const std::pair &p) - :first(p.first),second(p.second) -{ - ; -} // end pair::pair() - - -template - inline THRUST_HOST_DEVICE - void pair - ::swap(thrust::pair &p) -{ - using thrust::swap; - - swap(first, p.first); - swap(second, p.second); -} // end pair::swap() - - -template - inline THRUST_HOST_DEVICE - bool operator==(const pair &x, const pair &y) -{ - return x.first == y.first && x.second == y.second; -} // end operator==() - - -template - inline THRUST_HOST_DEVICE - bool operator<(const pair &x, const pair &y) -{ - return x.first < y.first || (!(y.first < x.first) && x.second < y.second); -} // end operator<() - - -template - inline THRUST_HOST_DEVICE - bool operator!=(const pair &x, const pair &y) -{ - return !(x == y); -} // end operator==() - - -template - inline THRUST_HOST_DEVICE - bool operator>(const pair &x, const pair &y) -{ - return y < x; -} // end operator<() - - -template - inline THRUST_HOST_DEVICE - bool operator<=(const pair &x, const pair &y) -{ - return !(y < x); -} // end operator<=() - - -template - inline THRUST_HOST_DEVICE - bool operator>=(const pair &x, const pair &y) -{ - return !(x < y); -} // end operator>=() - - -template - inline THRUST_HOST_DEVICE - void swap(pair &x, pair &y) -{ - return x.swap(y); -} // end swap() - - -template - inline THRUST_HOST_DEVICE - pair make_pair(T1 x, T2 y) -{ - return pair(x,y); -} // end make_pair() - - -// specializations of tuple_element for pair -template - struct tuple_element<0, pair> -{ - using type = T1; -}; // end tuple_element - -template - struct tuple_element<1, pair> -{ - using type = T2; -}; // end tuple_element - - -// specialization of tuple_size for pair -template - struct tuple_size> -{ - static const unsigned int value = 2; -}; // end tuple_size - - - -namespace detail -{ - - -template struct pair_get {}; - -template - struct pair_get<0, Pair> -{ - inline THRUST_HOST_DEVICE - const typename tuple_element<0, Pair>::type & - operator()(const Pair &p) const - { - return p.first; - } // end operator()() - - inline THRUST_HOST_DEVICE - typename tuple_element<0, Pair>::type & - operator()(Pair &p) const - { - return p.first; - } // end operator()() -}; // end pair_get - - -template - struct pair_get<1, Pair> -{ - inline THRUST_HOST_DEVICE - const typename tuple_element<1, Pair>::type & - operator()(const Pair &p) const - { - return p.second; - } // end operator()() - - inline THRUST_HOST_DEVICE - typename tuple_element<1, Pair>::type & - operator()(Pair &p) const - { - return p.second; - } // end operator()() -}; // end pair_get - -} // end detail - - - -template - inline THRUST_HOST_DEVICE - typename tuple_element >::type & - get(pair &p) -{ - return detail::pair_get >()(p); -} // end get() - -template - inline THRUST_HOST_DEVICE - const typename tuple_element >::type & - get(const pair &p) -{ - return detail::pair_get >()(p); -} // end get() - -THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl index 1524c0435e2a..eb586af02cd4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl @@ -77,7 +77,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator first, InputIterator last, @@ -97,7 +97,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 first, InputIterator1 last, @@ -142,7 +142,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator first, InputIterator last, @@ -162,7 +162,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 first, InputIterator1 last, @@ -253,7 +253,7 @@ ForwardIterator stable_partition(ForwardIterator first, ForwardIterator last, In } // end stable_partition() template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred) { using thrust::system::detail::generic::select_system; @@ -274,7 +274,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( InputIterator1 first, InputIterator1 last, InputIterator2 stencil, @@ -299,7 +299,7 @@ thrust::pair partition_copy( } // end partition_copy() template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred) { using thrust::system::detail::generic::select_system; @@ -320,7 +320,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( InputIterator1 first, InputIterator1 last, InputIterator2 stencil, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h index fed5fa8df6e6..04e2e325e428 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h @@ -38,11 +38,16 @@ #include #include +#include _THRUST_STD_INCLUDE(__type_traits/is_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_void.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cv.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cvref.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) #include _THRUST_STD_INCLUDE(cstddef) -#include _THRUST_STD_INCLUDE(type_traits) #if !THRUST_COMPILER(NVRTC) -#include +# include #endif // !THRUST_COMPILER(NVRTC) THRUST_NAMESPACE_BEGIN @@ -72,7 +77,7 @@ struct pointer_base { // void pointers should have no element type // note that we remove_cv from the Element type to get the value_type - using value_type = typename eval_if<_THRUST_STD::is_void_v<::internal::remove_cvref_t>, + using value_type = typename eval_if<_THRUST_STD::is_void_v<_THRUST_STD::remove_cvref_t>, _THRUST_STD::type_identity, _THRUST_STD::remove_cv>::type; @@ -85,7 +90,7 @@ struct pointer_base // void pointers should have no reference type // if no Reference type is given, just use reference using reference_type = - typename eval_if<_THRUST_STD::is_void_v<::internal::remove_cvref_t>, + typename eval_if<_THRUST_STD::is_void_v<_THRUST_STD::remove_cvref_t>, _THRUST_STD::type_identity, eval_if<_THRUST_STD::is_same_v, _THRUST_STD::type_identity>, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h index 45566c85dc4e..781e96edba8d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h @@ -23,8 +23,11 @@ #include -#include -#include +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__utility/forward.h) +#include _THRUST_STD_INCLUDE(bit) +#include _THRUST_STD_INCLUDE(cstdint) THRUST_NAMESPACE_BEGIN namespace detail @@ -40,14 +43,8 @@ class feistel_bijection { // Calculate number of bits needed to represent num_elements - 1 // Prevent zero - const uint64_t max_index = (m > 1 ? m : 1) - 1; - // Portable bit_width(max_index): std::bit_width is C++20 and unavailable without libhipcxx - uint64_t index_bits = 0; - for (uint64_t v = max_index; v != 0; v >>= 1) - { - ++index_bits; - } - const uint64_t total_bits = index_bits > 8 ? index_bits : 8; + const uint64_t max_index = _THRUST_STD::max(static_cast(1), m) - 1; + const uint64_t total_bits = static_cast(_THRUST_STD::max(8, _THRUST_STD::bit_width(max_index))); // Half bits rounded down L_bits = total_bits / 2; L_mask = (1ull << L_bits) - 1; @@ -110,8 +107,8 @@ template class random_bijection { private: - static_assert(::cuda::std::is_integral_v, "IndexType must be an integral type"); - static_assert(::cuda::std::is_convertible_v, + static_assert(_THRUST_STD::is_integral_v, "IndexType must be an integral type"); + static_assert(_THRUST_STD::is_convertible_v, "IndexType must be convertible to Bijection::index_type"); Bijection bijection; @@ -122,7 +119,7 @@ class random_bijection template THRUST_HOST_DEVICE random_bijection(IndexType n, URBG&& g) - : bijection(n, ::cuda::std::forward(g)) + : bijection(n, _THRUST_STD::forward(g)) , n(n) {} diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/raw_reference_cast.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/raw_reference_cast.h index df72c46bf092..df73c69b048e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/raw_reference_cast.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/raw_reference_cast.h @@ -31,8 +31,12 @@ #include #include -#include _THRUST_STD_INCLUDE(type_traits) -#include _THRUST_STD_INCLUDE(utility) +#include _THRUST_STD_INCLUDE(__tuple_dir/apply.h) +#include _THRUST_STD_INCLUDE(__type_traits/add_lvalue_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cv.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) +#include _THRUST_STD_INCLUDE(__utility/forward.h) // the order of declarations and definitions in this file is totally goofy // this header defines raw_reference_cast, which has a few overloads towards the bottom of the file @@ -172,11 +176,7 @@ THRUST_HOST_DEVICE auto raw_reference_cast(detail::tuple_of_iterator_references< if constexpr (detail::can_unwrap>) { using ResultTuple = tuple::type...>; -#if _THRUST_HAS_DEVICE_SYSTEM_STD return _THRUST_STD::apply( -#else - return THRUST_NS_QUALIFIER::apply( -#endif [](auto&&... refs) { return ResultTuple{raw_reference_cast(_THRUST_STD::forward(refs))...}; }, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl index 65b82a7b360f..8ecd6a3389fb 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl @@ -132,7 +132,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -157,7 +157,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -185,7 +185,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -286,7 +286,7 @@ void reduce_into(InputIterator first, InputIterator last, OutputIterator output, } template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -314,7 +314,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -350,7 +350,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/reference.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/reference.h index 133770c988ec..299118c48002 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/reference.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/reference.h @@ -31,14 +31,14 @@ # pragma system_header #endif // no system header #include -#include // for internal::remove_cvref_t #include #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(type_traits) -#endif +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cvref.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) #include @@ -91,7 +91,7 @@ class reference public: using pointer = Pointer; - using value_type = ::internal::remove_cvref_t; + using value_type = _THRUST_STD::remove_cvref_t; reference(reference const&) = default; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl index 829117096b0d..463bf4281b82 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl @@ -88,7 +88,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -121,7 +121,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -189,7 +189,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -219,7 +219,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -286,7 +286,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -319,7 +319,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -388,7 +388,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -421,7 +421,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -493,7 +493,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -539,7 +539,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -622,7 +622,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -663,7 +663,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -745,7 +745,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -791,7 +791,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -875,7 +875,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -921,7 +921,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h index a66f234f318c..b224c15da43c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h @@ -30,8 +30,6 @@ # pragma system_header #endif // no system header -#include _THRUST_STD_INCLUDE(type_traits) - THRUST_NAMESPACE_BEGIN namespace detail { @@ -45,13 +43,12 @@ THRUST_NAMESPACE_END #include #include #include -#include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) THRUST_NAMESPACE_BEGIN namespace detail diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.inl index 3e1494d44fd4..64610acebaa6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.inl @@ -28,12 +28,10 @@ #include #include -#include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__iterator/distance.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_trivially_copy_constructible.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h index e0ab6b44893d..d3f6ab12d3d4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h @@ -30,7 +30,8 @@ #include #include #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) // Include all active backend system implementations (generic, sequential, host and device) #include @@ -52,15 +53,15 @@ namespace detail { template THRUST_HOST_DEVICE - thrust::pair, typename thrust::pointer::difference_type> - down_cast_pair(Pair p) +_THRUST_STD::pair, typename thrust::pointer::difference_type> +down_cast_pair(Pair p) { // XXX should use a hypothetical thrust::static_pointer_cast here thrust::pointer ptr = thrust::pointer(static_cast(thrust::raw_pointer_cast(p.first))); using result_type = - thrust::pair, typename thrust::pointer::difference_type>; + _THRUST_STD::pair, typename thrust::pointer::difference_type>; return result_type(ptr, p.second); } // end down_cast_pair() } // namespace detail @@ -68,9 +69,9 @@ THRUST_HOST_DEVICE THRUST_EXEC_CHECK_DISABLE template THRUST_HOST_DEVICE - thrust::pair, typename thrust::pointer::difference_type> - get_temporary_buffer(const thrust::detail::execution_policy_base& exec, - typename thrust::pointer::difference_type n) +_THRUST_STD::pair, typename thrust::pointer::difference_type> +get_temporary_buffer(const thrust::detail::execution_policy_base& exec, + typename thrust::pointer::difference_type n) { using thrust::detail::get_temporary_buffer; // execute_with_allocator using thrust::system::detail::generic::get_temporary_buffer; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl deleted file mode 100644 index 5a6e7eb83e2a..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl +++ /dev/null @@ -1,1042 +0,0 @@ -/* - * Copyright 2008-2021 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// TODO(libhipcxx): remove this file once libhipcxx gets ready - -#include - -#include - -THRUST_NAMESPACE_BEGIN - -THRUST_EXEC_CHECK_DISABLE -template -THRUST_HOST_DEVICE inline void swap(Assignable1& a, Assignable2& b) -{ - Assignable1 temp = a; - a = b; - b = temp; -} // end swap() - -// define null_type for backwards compatibility -struct THRUST_DEPRECATED_BECAUSE("Please remove null_type from parameters to tuple<...>") null_type -{}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -// forward declaration for tuple -template < - class T0 = null_type, class T1 = null_type, class T2 = null_type, - class T3 = null_type, class T4 = null_type, class T5 = null_type, - class T6 = null_type, class T7 = null_type, class T8 = null_type, - class T9 = null_type> -class tuple; - -THRUST_SUPPRESS_DEPRECATED_POP - -template struct tuple_element; - -template - struct tuple_element_impl -{ - private: - using Next = typename T::tail_type; - - public: - /*! The result of this metafunction is returned in \c type. - */ - using type = typename tuple_element_impl::type; -}; // end tuple_element - -template - struct tuple_element_impl<0,T> -{ - using type = typename T::head_type; -}; - -template - struct tuple_element -{ - using type = typename std::add_const::type>::type; -}; - -template -struct tuple_element -{ - using type = typename std::add_volatile::type>::type; -}; - -template - struct tuple_element -{ - using type = typename std::add_cv::type>::type; -}; - -template -struct tuple_element{ - using type = typename tuple_element_impl::type; -}; - -// forward declaration of tuple_size -template struct tuple_size; - -template - struct tuple_size : public tuple_size {}; - -template - struct tuple_size : public tuple_size {}; - -template - struct tuple_size : public tuple_size {}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -/*! This metafunction returns the number of elements - * of a \p tuple type of interest. - * - * \tparam T A \c tuple type of interest. - * - * \see pair - * \see tuple - */ -template - struct tuple_size -{ - /*! The result of this metafunction is returned in \c value. - */ - static const int value = 1 + tuple_size::value; -}; // end tuple_size - -THRUST_SUPPRESS_DEPRECATED_POP - -// specializations for tuple_size -template<> - struct tuple_size< tuple<> > -{ - static const int value = 0; -}; // end tuple_size< tuple<> > - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> - struct tuple_size -{ - static const int value = 0; -}; // end tuple_size - -THRUST_SUPPRESS_DEPRECATED_POP - -// forward declaration of detail::cons -namespace detail -{ - -template struct cons; - -} // end detail - - -// -- some traits classes for get functions -template struct access_traits -{ - using const_type = const T&; - using non_const_type = T&; - - using parameter_type = const typename ::std::remove_cv::type&; - -// used as the tuple constructors parameter types -// Rationale: non-reference tuple element types can be cv-qualified. -// It should be possible to initialize such types with temporaries, -// and when binding temporaries to references, the reference must -// be non-volatile and const. 8.5.3. (5) -}; // end access_traits - -template struct access_traits -{ - using const_type = T&; - using non_const_type = T&; - - using parameter_type = T&; -}; // end access_traits - -// forward declarations of get() -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::non_const_type -// XXX we probably don't need to do this for any compiler we care about -jph -//get(cons& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)); -get(detail::cons& c); - -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::const_type -// XXX we probably don't need to do this for any compiler we care about -jph -//get(const cons& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)); -get(const detail::cons& c); - -namespace detail -{ - -// -- generate error template, referencing to non-existing members of this -// template is used to produce compilation errors intentionally -template -class generate_error; - -// - cons getters -------------------------------------------------------- -// called: get_class::get(aTuple) - -template< int N > -struct get_class -{ - template - THRUST_HOST_DEVICE - inline static RET get(const cons& t) - { - // XXX we may not need to deal with this for any compiler we care about -jph - //return get_class::BOOST_NESTED_TEMPLATE get(t.tail); - return get_class::template get(t.tail); - - // gcc 4.3 couldn't compile this: - //return get_class::get(t.tail); - } - - template - THRUST_HOST_DEVICE - inline static RET get(cons& t) - { - // XXX we may not need to deal with this for any compiler we care about -jph - //return get_class::BOOST_NESTED_TEMPLATE get(t.tail); - return get_class::template get(t.tail); - - // gcc 4.3 couldn't compile this: - //return get_class::get(t.tail); - } -}; // end get_class - -template<> -struct get_class<0> -{ - template - THRUST_HOST_DEVICE - inline static RET get(const cons& t) - { - return t.head; - } - - template - THRUST_HOST_DEVICE - inline static RET get(cons& t) - { - return t.head; - } -}; // get get_class<0> - - -template struct IF -{ - using RET = Then; -}; - -template struct IF -{ - using RET = Else; -}; - -// These helper templates wrap void types and plain function types. -// The rationale is to allow one to write tuple types with those types -// as elements, even though it is not possible to instantiate such object. -// E.g: using some_type = tuple; // ok -// but: some_type x; // fails - -template class non_storeable_type -{ - THRUST_HOST_DEVICE - non_storeable_type(); -}; - -template struct wrap_non_storeable_type -{ - // XXX is_function looks complicated; punt for now -jph - //typedef typename IF< - // THRUST_NS_QUALIFIER::detail::is_function::value, non_storeable_type, T - //>::RET type; - - using type = T; -}; - -template <> struct wrap_non_storeable_type -{ - using type = non_storeable_type; -}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template - struct cons -{ - using head_type = HT; - using tail_type = TT; - - using stored_head_type = typename - wrap_non_storeable_type::type; - - stored_head_type head; - tail_type tail; - - inline THRUST_HOST_DEVICE - typename access_traits::non_const_type - get_head() { return head; } - - inline THRUST_HOST_DEVICE - typename access_traits::non_const_type - get_tail() { return tail; } - - inline THRUST_HOST_DEVICE - typename access_traits::const_type - get_head() const { return head; } - - inline THRUST_HOST_DEVICE - typename access_traits::const_type - get_tail() const { return tail; } - - inline THRUST_HOST_DEVICE - cons(void) : head(), tail() {} - // cons() : head(detail::default_arg::f()), tail() {} - - // the argument for head is not strictly needed, but it prevents - // array type elements. This is good, since array type elements - // cannot be supported properly in any case (no assignment, - // copy works only if the tails are exactly the same type, ...) - - inline THRUST_HOST_DEVICE - cons(typename access_traits::parameter_type h, - const tail_type& t) - : head (h), tail(t) {} - - template - inline THRUST_HOST_DEVICE - cons( T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, - T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) - : head (t1), - tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, static_cast(null_type())) - {} - - template - inline THRUST_HOST_DEVICE - cons( const null_type& /*t1*/, T2& t2, T3& t3, T4& t4, T5& t5, - T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) - : head (), - tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, static_cast(null_type())) - {} - - - template - inline THRUST_HOST_DEVICE - cons( const cons& u ) : head(u.head), tail(u.tail) {} - - template - inline THRUST_HOST_DEVICE - cons( const cons& u ) : head(u.head), tail() {} - - cons(const cons &) = default; - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE - cons& operator=( const cons& u ) { - head = u.head; - tail = thrust::null_type(); - return *this; - } - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE - cons& operator=( const cons& u ) { - head=u.head; tail=u.tail; return *this; - } - - // must define assignment operator explicitly, implicit version is - // illformed if HT is a reference (12.8. (12)) - THRUST_EXEC_CHECK_DISABLE - inline THRUST_HOST_DEVICE - cons& operator=(const cons& u) { - head = u.head; tail = u.tail; return *this; - } - - // XXX enable when we support std::pair -jph - //template - //THRUST_HOST_DEVICE - //cons& operator=( const std::pair& u ) { - // //BOOST_STATIC_ASSERT(length::value == 2); // check length = 2 - // head = u.first; tail.head = u.second; return *this; - //} - - // get member functions (non-const and const) - template - THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element >::type - >::non_const_type - get() { - return thrust::get(*this); // delegate to non-member get - } - - template - THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element >::type - >::const_type - get() const { - return thrust::get(*this); // delegate to non-member get - } - - inline THRUST_HOST_DEVICE - void swap(cons &c) - { - using thrust::swap; - - swap(head, c.head); - tail.swap(c.tail); - } -}; - -template - struct cons -{ - using head_type = HT; - using tail_type = null_type; - using self_type = cons; - - using stored_head_type = typename - wrap_non_storeable_type::type; - stored_head_type head; - - typename access_traits::non_const_type - inline THRUST_HOST_DEVICE - get_head() { return head; } - - inline THRUST_HOST_DEVICE - null_type get_tail() { return null_type(); } - - inline THRUST_HOST_DEVICE - typename access_traits::const_type - get_head() const { return head; } - - inline THRUST_HOST_DEVICE - null_type get_tail() const { return null_type(); } - - inline THRUST_HOST_DEVICE - cons() : head() {} - - inline THRUST_HOST_DEVICE - cons(typename access_traits::parameter_type h, - const null_type& = null_type()) - : head (h) {} - - template - inline THRUST_HOST_DEVICE - cons(T1& t1, const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&) - : head (t1) {} - - inline THRUST_HOST_DEVICE - cons(const null_type&, - const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&) - : head () {} - - template - inline THRUST_HOST_DEVICE - cons( const cons& u ) : head(u.head) {} - - cons(const cons &) = default; - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE - cons& operator=(const cons& u ) - { - head = u.head; - return *this; - } - - // must define assignment operator explicitly, implicit version - // is illformed if HT is a reference - inline THRUST_HOST_DEVICE - cons& operator=(const cons& u) { head = u.head; return *this; } - - template - inline THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element::type - >::non_const_type - // XXX we probably don't need this for the compilers we care about -jph - //get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) - get(void) - { - return thrust::get(*this); - } - - template - inline THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element::type - >::const_type - // XXX we probably don't need this for the compilers we care about -jph - //get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) const - get(void) const - { - return thrust::get(*this); - } - - inline THRUST_HOST_DEVICE - void swap(cons &c) - { - using thrust::swap; - - swap(head, c.head); - } -}; // end cons - -template - struct map_tuple_to_cons -{ - using type = cons::type>; -}; // end map_tuple_to_cons - -// The empty tuple is a null_type -template <> - struct map_tuple_to_cons -{ - using type = null_type; -}; // end map_tuple_to_cons<...> - -THRUST_SUPPRESS_DEPRECATED_POP - -// --------------------------------------------------------------------------- -// The call_traits for make_tuple - -// Must be instantiated with plain or const plain types (not with references) - -// from template foo(const T& t) : make_tuple_traits::type -// from template foo(T& t) : make_tuple_traits::type - -// Conversions: -// T -> T, -// references -> compile_time_error -// array -> const ref array - - -template -struct make_tuple_traits { - using type = T; - - // commented away, see below (JJ) - // typedef typename IF< - // boost::is_function::value, - // T&, - // T>::RET type; - -}; - -// The is_function test was there originally for plain function types, -// which can't be stored as such (we must either store them as references or -// pointers). Such a type could be formed if make_tuple was called with a -// reference to a function. -// But this would mean that a const qualified function type was formed in -// the make_tuple function and hence make_tuple can't take a function -// reference as a parameter, and thus T can't be a function type. -// So is_function test was removed. -// (14.8.3. says that type deduction fails if a cv-qualified function type -// is created. (It only applies for the case of explicitly specifying template -// args, though?)) (JJ) - -template -struct make_tuple_traits { - using error = typename detail::generate_error::do_not_use_with_reference_type; -}; - -// Arrays can't be stored as plain types; convert them to references. -// All arrays are converted to const. This is because make_tuple takes its -// parameters as const T& and thus the knowledge of the potential -// non-constness of actual argument is lost. -template struct make_tuple_traits { - using type = const T (&)[n]; -}; - -template -struct make_tuple_traits { - using type = const T (&)[n]; -}; - -template struct make_tuple_traits { - using type = const volatile T (&)[n]; -}; - -template -struct make_tuple_traits { - using type = const volatile T (&)[n]; -}; - -// XXX enable these if we ever care about reference_wrapper -jph -//template -//struct make_tuple_traits >{ -// using type = T&; -//}; -// -//template -//struct make_tuple_traits >{ -// using type = T&; -//}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -// a helper traits to make the make_tuple functions shorter (Vesa Karvonen's -// suggestion) -template < - class T0 = null_type, class T1 = null_type, class T2 = null_type, - class T3 = null_type, class T4 = null_type, class T5 = null_type, - class T6 = null_type, class T7 = null_type, class T8 = null_type, - class T9 = null_type -> -struct make_tuple_mapper { - using type = tuple::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type>; -}; - -THRUST_SUPPRESS_DEPRECATED_POP - -} // end detail - - -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::non_const_type -get(detail::cons& c) -{ - //return detail::get_class::BOOST_NESTED_TEMPLATE - - // gcc 4.3 couldn't compile this: - //return detail::get_class:: - - return detail::get_class::template - get< - typename access_traits< - typename tuple_element >::type - >::non_const_type, - HT,TT - >(c); -} - - -// get function for const cons-lists, returns a const reference to -// the element. If the element is a reference, returns the reference -// as such (that is, can return a non-const reference) -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::const_type -get(const detail::cons& c) -{ - //return detail::get_class::BOOST_NESTED_TEMPLATE - - // gcc 4.3 couldn't compile this: - //return detail::get_class:: - - return detail::get_class::template - get< - typename access_traits< - typename tuple_element >::type - >::const_type, - HT,TT - >(c); -} - - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6,t7); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6,t7,t8); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9); -} // end make_tuple() - - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0) -{ - return tuple(t0); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1) -{ - return tuple(t0,t1); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2) -{ - return tuple(t0,t1,t2); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3) -{ - return tuple(t0,t1,t2,t3); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4) -{ - return tuple(t0,t1,t2,t3,t4); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5) -{ - return tuple(t0,t1,t2,t3,t4,t5); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6,t7); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6,t7,t8); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8, T9 &t9) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9); -} - -template< - typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, - typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9 -> -THRUST_HOST_DEVICE inline -void swap(thrust::tuple &x, - thrust::tuple &y) -{ - return x.swap(y); -} - - - -namespace detail -{ - -template -THRUST_HOST_DEVICE -inline bool eq(const T1& lhs, const T2& rhs) { - return lhs.get_head() == rhs.get_head() && - eq(lhs.get_tail(), rhs.get_tail()); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool eq(const null_type&, const null_type&) { return true; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool neq(const T1& lhs, const T2& rhs) { - return lhs.get_head() != rhs.get_head() || - neq(lhs.get_tail(), rhs.get_tail()); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool neq(const null_type&, const null_type&) { return false; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool lt(const T1& lhs, const T2& rhs) { - return (lhs.get_head() < rhs.get_head()) || - (!(rhs.get_head() < lhs.get_head()) && - lt(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool lt(const null_type&, const null_type&) { return false; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool gt(const T1& lhs, const T2& rhs) { - return (lhs.get_head() > rhs.get_head()) || - (!(rhs.get_head() > lhs.get_head()) && - gt(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool gt(const null_type&, const null_type&) { return false; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool lte(const T1& lhs, const T2& rhs) { - return lhs.get_head() <= rhs.get_head() && - ( !(rhs.get_head() <= lhs.get_head()) || - lte(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool lte(const null_type&, const null_type&) { return true; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool gte(const T1& lhs, const T2& rhs) { - return lhs.get_head() >= rhs.get_head() && - ( !(rhs.get_head() >= lhs.get_head()) || - gte(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool gte(const null_type&, const null_type&) { return true; } - -THRUST_SUPPRESS_DEPRECATED_POP - -} // end detail - - - -// equal ---- - -template -THRUST_HOST_DEVICE -inline bool operator==(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::eq(lhs, rhs); -} // end operator==() - -// not equal ----- - -template -THRUST_HOST_DEVICE -inline bool operator!=(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::neq(lhs, rhs); -} // end operator!=() - -// < -template -THRUST_HOST_DEVICE -inline bool operator<(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::lt(lhs, rhs); -} // end operator<() - -// > -template -THRUST_HOST_DEVICE -inline bool operator>(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::gt(lhs, rhs); -} // end operator>() - -// <= -template -THRUST_HOST_DEVICE -inline bool operator<=(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::lte(lhs, rhs); -} // end operator<=() - -// >= -template -THRUST_HOST_DEVICE -inline bool operator>=(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::gte(lhs, rhs); -} // end operator>=() - -THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_deduction.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_deduction.h index 31a0d177ceb1..321e7ab21659 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_deduction.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_deduction.h @@ -19,10 +19,7 @@ #include -#include _THRUST_STD_INCLUDE(utility) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(type_traits) -#endif +#include _THRUST_STD_INCLUDE(__utility/forward.h) /////////////////////////////////////////////////////////////////////////////// diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h index aa076167d44a..2c76658fb3b0 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h @@ -32,65 +32,17 @@ # pragma system_header #endif // no system header -#include _THRUST_STD_INCLUDE(type_traits) - -#include - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD && _THRUST_USE_ROCPRIM -// # include -# include -#endif // !_THRUST_HAS_DEVICE_SYSTEM_STD - -// TODO(libhipcxx): remove this namespace once libhipcxx gets ready -namespace internal -{ - -#if _THRUST_HAS_DEVICE_SYSTEM_STD - -using _THRUST_STD::is_arithmetic; -using _THRUST_STD::is_integral; -using _THRUST_STD::is_integral_v; -using _THRUST_STD::make_unsigned; - -template -using make_unsigned_t = _THRUST_STD::make_unsigned_t; - -template -using decay_t = _THRUST_STD::decay_t; -template -using remove_cvref = _THRUST_STD::remove_cvref; -template -using remove_cvref_t = _THRUST_STD::remove_cvref_t; - -#else // !_THRUST_HAS_DEVICE_SYSTEM_STD - -// TODO: Use rocprim version of is_arithmetic, is_integral, make_unsigned and make_unsigned_t for consistency. -// However, replacing with rocprim::is_arithmetic currently causes issues. -// Keeping standard versions for now until compatibility is resolved. -using ::std::is_arithmetic; -using ::std::is_integral; -using ::std::is_integral_v; -using ::std::make_unsigned; - -template -using make_unsigned_t = typename ::std::make_unsigned::type; - -template -// If we're not on Windows and we have libstdc++ >= 10, we can use the __decay_t -// builtin to reduce compilation time. -# if defined(_WIN32) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 10) -using decay_t = ::std::decay_t; -# else -using decay_t = ::std::__decay_t; -# endif -template -using remove_cvref = ::std::remove_cv<::std::remove_reference_t>; -template -using remove_cvref_t = ::std::remove_cv_t<::std::remove_reference_t>; - -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD - -} // namespace internal +#include _THRUST_STD_INCLUDE(__functional/invoke.h) +#include _THRUST_STD_INCLUDE(__type_traits/conjunction.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/integral_constant.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_arithmetic.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) +// [NON-CCCL PARITY BEGIN] +#include _THRUST_STD_INCLUDE(cstddef) +// [NON-CCCL PARITY END] THRUST_NAMESPACE_BEGIN @@ -107,14 +59,14 @@ using true_type = _THRUST_STD::true_type; using false_type = _THRUST_STD::false_type; template -struct is_non_bool_integral : public ::internal::is_integral +struct is_non_bool_integral : public _THRUST_STD::is_integral {}; template <> struct is_non_bool_integral : public false_type {}; template -struct is_non_bool_arithmetic : public ::internal::is_arithmetic +struct is_non_bool_arithmetic : public _THRUST_STD::is_arithmetic {}; template <> struct is_non_bool_arithmetic : public false_type @@ -167,7 +119,7 @@ struct disable_if_convertible : disable_if<_THRUST_STD::is_convertible:: {}; template -struct is_numeric : ::internal::_And<_THRUST_STD::is_convertible, _THRUST_STD::is_convertible> +struct is_numeric : _THRUST_STD::_And<_THRUST_STD::is_convertible, _THRUST_STD::is_convertible> {}; // end is_numeric struct largest_available_float @@ -182,15 +134,7 @@ struct larger_type {}; template -#if _THRUST_HAS_DEVICE_SYSTEM_STD using invoke_result = _THRUST_STD::invoke_result; -#else // TODO(libhipcxx): remove this path of code once libhipcxx gets ready -# if _THRUST_USE_ROCPRIM -using invoke_result = ::rocprim::invoke_result; -# else -using invoke_result = ::std::invoke_result; -# endif -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD template using invoke_result_t = typename invoke_result::type; @@ -224,58 +168,3 @@ using detail::integral_constant; using detail::true_type; THRUST_NAMESPACE_END - -// TODO(libhipcxx): remove this namespace and replace ::internal::common_type_t -// with _THRUST_STD::common_type_t in rocThrust once libhipcxx gets ready -namespace internal -{ - -#if _THRUST_HAS_DEVICE_SYSTEM_STD - -template -using common_type_t = _THRUST_STD::common_type_t; - -#else // !_THRUST_HAS_DEVICE_SYSTEM_STD - -namespace detail -{ - -template -struct common_type; - -template -struct common_type::type, - typename _THRUST_STD::is_floating_point::type>::value>::type> -{ - using type = typename THRUST_NS_QUALIFIER::detail::larger_type::type; -}; - -template -struct common_type< - T1, - T2, - typename _THRUST_STD::enable_if< - _And::type, typename _THRUST_STD::is_floating_point::type>::value>::type> -{ - using type = T2; -}; - -template -struct common_type::type, - typename is_integral::type>::value>::type> -{ - using type = T1; -}; - -} // namespace detail - -template -using common_type_t = typename detail::common_type::type; - -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD - -} // namespace internal diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/has_member_function.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/has_member_function.h index d3d10aefbdea..95e4b004cfd6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/has_member_function.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/has_member_function.h @@ -28,10 +28,10 @@ #include -#include // for std::declval -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_void.h) +#include _THRUST_STD_INCLUDE(__utility/declval.h) #define __THRUST_DEFINE_HAS_MEMBER_FUNCTION(trait_name, member_function_name) \ template \ diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_call_possible.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_call_possible.h index de8a523d8d3e..0e4d1b7ed10a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_call_possible.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_call_possible.h @@ -29,9 +29,7 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/add_lvalue_reference.h) // inspired by Roman Perepelitsa's presentation from comp.lang.c++.moderated // based on the implementation here: http://www.rsdn.ru/forum/cpp/2759773.1.aspx diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_commutative.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_commutative.h index 3a7c396a8798..a498250a3db9 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_commutative.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/is_commutative.h @@ -37,31 +37,31 @@ struct is_commutative : public _THRUST_STD::false_type {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; template -struct is_commutative> : public ::internal::is_arithmetic +struct is_commutative> : public _THRUST_STD::is_arithmetic {}; } // end namespace detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/iterator/is_output_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/iterator/is_output_iterator.h index 6606b074adb9..e46f062e3389 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/iterator/is_output_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/iterator/is_output_iterator.h @@ -29,7 +29,9 @@ #include #include -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_void.h) +#include _THRUST_STD_INCLUDE(__type_traits/void_t.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/minimum_type.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/minimum_type.h index 377b6fdfa96c..4526f0ecf9d4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/minimum_type.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/minimum_type.h @@ -26,7 +26,9 @@ # pragma system_header #endif // no system header -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/pointer_traits.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/pointer_traits.h index 12d330b1aea5..910371b5ca27 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/pointer_traits.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits/pointer_traits.h @@ -25,15 +25,20 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include #include #include #include +#include _THRUST_STD_INCLUDE(__type_traits/add_lvalue_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/conjunction.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_void.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) #include _THRUST_STD_INCLUDE(cstddef) -#include _THRUST_STD_INCLUDE(type_traits) THRUST_NAMESPACE_BEGIN namespace detail @@ -292,15 +297,15 @@ struct is_pointer_system_convertible : _THRUST_STD::is_convertible struct is_pointer_convertible - : ::internal::_And< + : _THRUST_STD::_And< _THRUST_STD::is_convertible::type*, typename pointer_element::type*>, is_pointer_system_convertible> {}; template struct is_void_pointer_system_convertible - : ::internal::_And<_THRUST_STD::is_same::type, void>, - is_pointer_system_convertible> + : _THRUST_STD::_And<_THRUST_STD::is_same::type, void>, + is_pointer_system_convertible> {}; // avoid inspecting traits of the arguments if they aren't known to be pointers diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl index 8af545a0905b..6cc3e2342991 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl @@ -104,7 +104,7 @@ THRUST_HOST_DEVICE OutputIterator unique_copy( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -117,7 +117,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -135,7 +135,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -160,7 +160,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -233,7 +233,7 @@ OutputIterator unique_copy(InputIterator first, InputIterator last, OutputIterat } // end unique_copy() template -thrust::pair +_THRUST_STD::pair unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first) { using thrust::system::detail::generic::select_system; @@ -248,7 +248,7 @@ unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIt } // end unique_by_key() template -thrust::pair unique_by_key( +_THRUST_STD::pair unique_by_key( ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first, BinaryPredicate binary_pred) { using thrust::system::detail::generic::select_system; @@ -263,7 +263,7 @@ thrust::pair unique_by_key( } // end unique_by_key() template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -291,7 +291,7 @@ template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h index 8e353e87bd76..4d7024d41efa 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h @@ -33,22 +33,18 @@ #endif // no system header #include -#include #include #include #include #include _THRUST_STD_INCLUDE(__iterator/iterator_traits.h) +#include _THRUST_STD_INCLUDE(__iterator/reverse_iterator.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) +#include _THRUST_STD_INCLUDE(__utility/swap.h) #include _THRUST_STD_INCLUDE(initializer_list) -#include _THRUST_STD_INCLUDE(iterator) -#include _THRUST_STD_INCLUDE(utility) #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - -#include _THRUST_STD_INCLUDE(initializer_list) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl index 984e97a9dbf0..aca2a2b2499a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl @@ -26,25 +26,27 @@ # pragma system_header #endif // no system header -#include #include -#include #include #include #include #include -#include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__algorithm/max.h) -# include _THRUST_STD_INCLUDE(__algorithm/min.h) -#endif -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__algorithm/max.h) +#include _THRUST_STD_INCLUDE(__algorithm/min.h) +#include _THRUST_STD_INCLUDE(__functional/operations.h) +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__iterator/distance.h) +#include _THRUST_STD_INCLUDE(__iterator/next.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_trivially_constructible.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) +#include _THRUST_STD_INCLUDE(initializer_list) #include @@ -681,7 +683,7 @@ void vector_base::insert(iterator position, InputIterator first, Input { // we could have received insert(position, n, x), so disambiguate on the // type of InputIterator - using integral = typename ::internal::is_integral; + using integral = typename _THRUST_STD::is_integral; insert_dispatch(position, first, last, integral()); } // end vector_base::insert() diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/device_vector.h b/projects/hipccl/hipccl3/rocthrust/thrust/device_vector.h index 2e4ac69d453a..a02617919b3e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/device_vector.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/device_vector.h @@ -33,8 +33,8 @@ #include #include +#include _THRUST_STD_INCLUDE(__utility/move.h) #include _THRUST_STD_INCLUDE(initializer_list) -#include _THRUST_STD_INCLUDE(utility) #include diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/distance.h b/projects/hipccl/hipccl3/rocthrust/thrust/distance.h index c9ed0b1ebd8c..4afe345f5fb6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/distance.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/distance.h @@ -29,9 +29,9 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include -#include _THRUST_STD_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(__iterator/distance.h) +#include _THRUST_STD_INCLUDE(__iterator/iterator_traits.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h index 128ff58d614d..07e0f689667a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h @@ -30,15 +30,10 @@ # pragma system_header #endif // no system header #include -#include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__algorithm/max.h) -# include _THRUST_STD_INCLUDE(__algorithm/min.h) -#endif +#include _THRUST_STD_INCLUDE(__algorithm/max.h) +#include _THRUST_STD_INCLUDE(__algorithm/min.h) +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -480,7 +475,7 @@ ForwardIterator max_element(ForwardIterator first, ForwardIterator last, BinaryP * #include * ... * int data[6] = {1, 0, 2, 2, 1, 3}; - * thrust::pair result = thrust::minmax_element(thrust::host, data, data + 6); + * _THRUST_STD::pair result = thrust::minmax_element(thrust::host, data, data + 6); * * // result.first is data + 1 * // result.second is data + 5 @@ -493,7 +488,7 @@ ForwardIterator max_element(ForwardIterator first, ForwardIterator last, BinaryP * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last); /*! \p minmax_element finds the smallest and largest elements in the range [first, last). @@ -514,7 +509,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * #include * ... * int data[6] = {1, 0, 2, 2, 1, 3}; - * thrust::pair result = thrust::minmax_element(data, data + 6); + * _THRUST_STD::pair result = thrust::minmax_element(data, data + 6); * * // result.first is data + 1 * // result.second is data + 5 @@ -527,7 +522,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -thrust::pair minmax_element(ForwardIterator first, ForwardIterator last); +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last); /*! \p minmax_element finds the smallest and largest elements in the range [first, last). * It returns a pair of iterators (imin, imax) where \c imin is the same iterator @@ -576,7 +571,7 @@ thrust::pair minmax_element(ForwardIterator fi * ... * key_value data[4] = { {4,5}, {0,7}, {2,3}, {6,1} }; * - * thrust::pair extrema = thrust::minmax_element(thrust::host, data, data + 4, + * _THRUST_STD::pair extrema = thrust::minmax_element(thrust::host, data, data + 4, * compare_key_value()); * * // extrema.first == data + 1 @@ -590,7 +585,7 @@ thrust::pair minmax_element(ForwardIterator fi * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -637,7 +632,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * ... * key_value data[4] = { {4,5}, {0,7}, {2,3}, {6,1} }; * - * thrust::pair extrema = thrust::minmax_element(data, data + 4, compare_key_value()); + * _THRUST_STD::pair extrema = thrust::minmax_element(data, data + 4, compare_key_value()); * * // extrema.first == data + 1 * // *extrema.first == {0,7} @@ -650,7 +645,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -thrust::pair +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last, BinaryPredicate comp); /*! \} // end extrema diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/functional.h b/projects/hipccl/hipccl3/rocthrust/thrust/functional.h index ee3d83666188..f48ca6bea437 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/functional.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/functional.h @@ -31,12 +31,15 @@ #endif // no system header #include -#include -#include -#include -#include _THRUST_LIBCXX_INCLUDE(functional) -#include _THRUST_STD_INCLUDE(functional) +#include _THRUST_LIBCXX_INCLUDE(__functional/maximum.h) +#include _THRUST_LIBCXX_INCLUDE(__functional/minimum.h) +#include _THRUST_STD_INCLUDE(__functional/not_fn.h) +#include _THRUST_STD_INCLUDE(__functional/operations.h) +#include _THRUST_STD_INCLUDE(__type_traits/decay.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_constructible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_move_constructible.h) +#include _THRUST_STD_INCLUDE(__utility/forward.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/host_vector.h b/projects/hipccl/hipccl3/rocthrust/thrust/host_vector.h index 0178b6c6a9f1..fe929c5c1d97 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/host_vector.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/host_vector.h @@ -30,11 +30,11 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include +#include _THRUST_STD_INCLUDE(__host_stdlib/memory) +#include _THRUST_STD_INCLUDE(__utility/move.h) #include _THRUST_STD_INCLUDE(initializer_list) -#include _THRUST_STD_INCLUDE(utility) #include diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/constant_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/constant_iterator.h index 836883436bab..769694dbc176 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/constant_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/constant_iterator.h @@ -32,8 +32,8 @@ #include #include +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) #include _THRUST_STD_INCLUDE(cstdint) -#include _THRUST_STD_INCLUDE(type_traits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h index cafb596997ca..8d0b76d0cfab 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h @@ -40,21 +40,18 @@ # pragma system_header #endif // no system header -#include -#include #include #include #include #include #include +#include _THRUST_LIBCXX_INCLUDE(__type_traits/is_floating_point.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) #include _THRUST_STD_INCLUDE(cstddef) -#include _THRUST_STD_INCLUDE(type_traits) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(type_traits) -#else -# include -#endif THRUST_NAMESPACE_BEGIN @@ -65,7 +62,7 @@ namespace detail { template using counting_iterator_difference_type = - ::internal::If<::internal::is_integral_v && sizeof(Number) < sizeof(int), int, _THRUST_STD::ptrdiff_t>; + _THRUST_STD::_If<_THRUST_STD::is_integral_v && sizeof(Number) < sizeof(int), int, _THRUST_STD::ptrdiff_t>; template struct make_counting_iterator_base @@ -74,9 +71,9 @@ struct make_counting_iterator_base _THRUST_STD::type_identity, _THRUST_STD::type_identity>::type; - using traversal = replace_if_use_default>; + using traversal = replace_if_use_default>; using difference = - replace_if_use_default>>; + replace_if_use_default>>; // our implementation departs from Boost's in that counting_iterator::dereference // returns a copy of its counter, rather than a reference to it. returning a reference @@ -290,7 +287,7 @@ class THRUST_DECLSPEC_EMPTY_BASES counting_iterator THRUST_HOST_DEVICE difference_type distance_to( counting_iterator const& y) const { - if constexpr (::internal::is_integral::value) + if constexpr (_THRUST_STD::is_integral_v) { return static_cast(y.base()) - static_cast(this->base()); } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h index ee65e3affbf3..08e1fd7065e7 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h @@ -26,13 +26,15 @@ # pragma system_header #endif // no system header -#include #include #include #include #include -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__type_traits/add_lvalue_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) THRUST_NAMESPACE_BEGIN @@ -50,8 +52,8 @@ namespace detail { // If T is use_default, return the result of invoking DefaultNullaryFn, otherwise return T. template -using replace_if_use_default = - typename ::internal::If<_THRUST_STD::is_same_v, DefaultNullaryFn, _THRUST_STD::type_identity>::type; +using replace_if_use_default = typename _THRUST_STD:: + _If<_THRUST_STD::is_same_v, DefaultNullaryFn, _THRUST_STD::type_identity>::type; // A metafunction which computes an iterator_adaptor's base class, a specialization of iterator_facade. template >; using reference = replace_if_use_default, - lazy_trait, - _THRUST_STD::add_lvalue_reference>>; + _THRUST_STD::_If<_THRUST_STD::is_same_v, + lazy_trait, + _THRUST_STD::add_lvalue_reference>>; using difference = replace_if_use_default>; public: diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h index e1b0bdf02543..ea90a4f9143e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h @@ -26,15 +26,10 @@ # pragma system_header #endif // no system header -#include #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail @@ -58,9 +53,9 @@ THRUST_HOST_DEVICE auto cat_to_traversal_impl(const output_device_iterator_tag&) template struct iterator_category_to_traversal { - using type = ::internal::If<_THRUST_STD::is_convertible_v, - CategoryOrTraversal, - decltype(cat_to_traversal_impl(CategoryOrTraversal{}))>; + using type = _THRUST_STD::_If<_THRUST_STD::is_convertible_v, + CategoryOrTraversal, + decltype(cat_to_traversal_impl(CategoryOrTraversal{}))>; }; template diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h index b9664cdbbd06..1b874f44ebeb 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h @@ -25,7 +25,6 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include #include @@ -36,8 +35,11 @@ #include #include -#include _THRUST_STD_INCLUDE(iterator) -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__iterator/iterator_traits.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) THRUST_NAMESPACE_BEGIN @@ -99,42 +101,42 @@ inline constexpr bool is_iterator_category = is_host_iterator_category || is_ // standard system iterators template -using iterator_facade_default_category_std = ::internal::If< +using iterator_facade_default_category_std = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, _THRUST_STD::random_access_iterator_tag, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, _THRUST_STD::bidirectional_iterator_tag, _THRUST_STD::forward_iterator_tag>>, - ::internal::If< // we differ from Boost here + _THRUST_STD::_If< // we differ from Boost here _THRUST_STD::is_convertible_v, _THRUST_STD::input_iterator_tag, Traversal>>; // host system iterators (basically same as standard system iterators) template -using iterator_facade_default_category_host = ::internal::If< +using iterator_facade_default_category_host = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, random_access_host_iterator_tag, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, bidirectional_host_iterator_tag, forward_host_iterator_tag>>, - ::internal::If< // we differ from Boost here + _THRUST_STD::_If< // we differ from Boost here _THRUST_STD::is_convertible_v, input_host_iterator_tag, Traversal>>; // device system iterators template -using iterator_facade_default_category_device = ::internal::If< +using iterator_facade_default_category_device = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, random_access_device_iterator_tag, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, bidirectional_device_iterator_tag, forward_device_iterator_tag>>, - ::internal::If< + _THRUST_STD::_If< // XXX note we differ from Boost here _THRUST_STD::is_convertible_v, input_device_iterator_tag, @@ -146,15 +148,15 @@ using iterator_facade_default_category_any = iterator_category_with_system_and_traversal, any_system_tag, Traversal>; template -using iterator_facade_default_category = ::internal::If< +using iterator_facade_default_category = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, iterator_facade_default_category_any, // check for host system - ::internal::If< + _THRUST_STD::_If< _THRUST_STD::is_convertible_v, iterator_facade_default_category_host, // check for device system - ::internal::If< + _THRUST_STD::_If< _THRUST_STD::is_convertible_v, iterator_facade_default_category_device, // if we don't recognize the system, get a standard iterator category and combine it with System & Traversal @@ -166,17 +168,18 @@ struct iterator_facade_category_impl using category = iterator_facade_default_category; // we must be able to deduce both Traversal & System from category, otherwise, munge them all together - using type = ::internal::If<_THRUST_STD::is_same_v::type> - && _THRUST_STD::is_same_v::type>, - category, - iterator_category_with_system_and_traversal>; + using type = + _THRUST_STD::_If<_THRUST_STD::is_same_v::type> + && _THRUST_STD::is_same_v::type>, + category, + iterator_category_with_system_and_traversal>; }; template using iterator_facade_category_t = - typename ::internal::If, - _THRUST_STD::type_identity, - iterator_facade_category_impl>::type; + typename _THRUST_STD::_If, + _THRUST_STD::type_identity, + iterator_facade_category_impl>::type; } // namespace detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h index 816a5c04fba4..5328a24b0667 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h @@ -25,13 +25,11 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include + #include #include #include -#include _THRUST_STD_INCLUDE(type_traits) - THRUST_NAMESPACE_BEGIN namespace detail { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h index 25fb17eb1d39..ed9ee602357f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h @@ -29,15 +29,12 @@ #include #include -#include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(tuple) -# include _THRUST_STD_INCLUDE(type_traits) -#else -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__utility/move.h) +#include _THRUST_STD_INCLUDE(__utility/pair.h) +#include _THRUST_STD_INCLUDE(tuple) THRUST_NAMESPACE_BEGIN @@ -55,7 +52,6 @@ struct maybe_unwrap_nested } }; -#if _THRUST_HAS_DEVICE_SYSTEM_STD template struct maybe_unwrap_nested, tuple_of_iterator_references> { @@ -64,7 +60,6 @@ struct maybe_unwrap_nested, tuple_of_iterator_references> return t.template __to_tuple(typename _THRUST_STD::__make_tuple_indices::type{}); } }; -#endif template class tuple_of_iterator_references : public tuple @@ -98,7 +93,7 @@ class tuple_of_iterator_references : public tuple // XXX might be worthwhile to guard this with an enable_if is_assignable THRUST_EXEC_CHECK_DISABLE template - THRUST_HOST_DEVICE tuple_of_iterator_references& operator=(const pair& other) + THRUST_HOST_DEVICE tuple_of_iterator_references& operator=(const _THRUST_STD::pair& other) { super_t::operator=(other); return *this; @@ -117,13 +112,11 @@ class tuple_of_iterator_references : public tuple return *this; } -#if _THRUST_HAS_DEVICE_SYSTEM_STD template = 0> THRUST_HOST_DEVICE constexpr operator tuple() const { return __to_tuple(typename _THRUST_STD::__make_tuple_indices::type{}); } -#endif // this overload of swap() permits swapping tuple_of_iterator_references returned as temporaries from // iterator dereferences @@ -133,29 +126,21 @@ class tuple_of_iterator_references : public tuple x.swap(y); } -#if _THRUST_HAS_DEVICE_SYSTEM_STD template THRUST_HOST_DEVICE constexpr tuple __to_tuple(_THRUST_STD::__tuple_indices) const { return {maybe_unwrap_nested{}(get(*this))...}; } -#endif }; } // namespace detail THRUST_NAMESPACE_END -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN -#else -THRUST_NAMESPACE_BEGIN -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD template inline constexpr bool __is_tuple_of_iterator_references_v> = true; -#endif // define tuple_size, tuple_element, etc. template @@ -165,18 +150,10 @@ struct tuple_size struct tuple_element> -#if _THRUST_HAS_DEVICE_SYSTEM_STD : _THRUST_STD::tuple_element> -#else - : THRUST_NS_QUALIFIER::tuple_element> -#endif {}; -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_END -#else -THRUST_NAMESPACE_END -#endif // structured bindings support #if !THRUST_COMPILER(NVRTC) @@ -189,11 +166,7 @@ struct tuple_size struct tuple_element> -# if _THRUST_HAS_DEVICE_SYSTEM_STD : _THRUST_STD::tuple_element> -# else - : THRUST_NS_QUALIFIER::tuple_element> -# endif {}; } // namespace std #endif // !THRUST_COMPILER(NVRTC) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_categories.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_categories.h index a4997ace56f5..b0e16b75abc6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_categories.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_categories.h @@ -42,7 +42,7 @@ #include #include -#include _THRUST_STD_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(__iterator/iterator_traits.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h index 4e7f19b75827..da8d36d3883f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h @@ -40,15 +40,9 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail @@ -57,9 +51,9 @@ namespace detail // it's legal to access IteratorFacade2::difference_type template using distance_from_result = - ::internal::If<_THRUST_STD::is_convertible_v, - typename IteratorFacade1::difference_type, - typename IteratorFacade2::difference_type>; + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, + typename IteratorFacade1::difference_type, + typename IteratorFacade2::difference_type>; } // namespace detail /*! \addtogroup iterators diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/reverse_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/reverse_iterator.h index 3577172a965a..f8e35e3d3d2c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/reverse_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/reverse_iterator.h @@ -40,7 +40,7 @@ # pragma system_header #endif // no system header -#include _THRUST_STD_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(__iterator/reverse_iterator.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/shuffle_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/shuffle_iterator.h index 8c3abcf7f0a0..11446bee9b01 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/shuffle_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/shuffle_iterator.h @@ -33,7 +33,12 @@ #include #include -#include +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_constructible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__utility/forward.h) +#include _THRUST_STD_INCLUDE(cstdint) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h index c9ef48b7d19f..4a22fdcd9e09 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h @@ -42,21 +42,18 @@ #endif // no system header #include -#include #include #include #include #include -#include _THRUST_STD_INCLUDE(type_traits) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(functional) -#endif - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif +#include _THRUST_STD_INCLUDE(__functional/identity.h) +#include _THRUST_STD_INCLUDE(__functional/invoke.h) +#include _THRUST_STD_INCLUDE(__memory/construct_at.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_copy_assignable.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_copy_constructible.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cvref.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_reference.h) THRUST_NAMESPACE_BEGIN @@ -92,7 +89,7 @@ struct make_transform_iterator_base { private: using reference = replace_if_use_default>; - using value_type = replace_if_use_default>; + using value_type = replace_if_use_default>; public: using type = @@ -279,8 +276,8 @@ class transform_iterator } else if constexpr (_THRUST_STD::is_copy_constructible_v) { - ::internal::__destroy_at(&m_f); - ::internal::__construct_at(&m_f, other.m_f); + _THRUST_STD::__destroy_at(&m_f); + _THRUST_STD::__construct_at(&m_f, other.m_f); } else { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h index f5911d369c05..a35324653946 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h @@ -28,9 +28,6 @@ #pragma once -// TODO(libhipcxx): remove all the code in the path of !_THRUST_HAS_DEVICE_SYSTEM_STD -// once libhipcxx gets ready - #include #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) @@ -41,24 +38,21 @@ # pragma system_header #endif // no system header -#include #include #include #include #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -# include -#endif - -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(tuple) -# include _THRUST_STD_INCLUDE(type_traits) -# include _THRUST_STD_INCLUDE(utility) -#endif + +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/enable_if.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_constructible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__utility/declval.h) +#include _THRUST_STD_INCLUDE(__utility/forward.h) +#include _THRUST_STD_INCLUDE(tuple) THRUST_NAMESPACE_BEGIN @@ -67,7 +61,6 @@ class zip_iterator; namespace detail { -#if _THRUST_HAS_DEVICE_SYSTEM_STD template struct make_zip_iterator_base { @@ -108,288 +101,6 @@ struct make_zip_iterator_base<_THRUST_STD::tuple> reference, difference_type>; }; -#else -// Functors to be used with tuple algorithms -// -template -class advance_iterator -{ -public: - inline THRUST_HOST_DEVICE advance_iterator(DiffType step) - : m_step(step) - {} - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE void operator()(Iterator& it) const - { - _THRUST_STD::advance(it, m_step); - } - -private: - DiffType m_step; -}; // end advance_iterator - -struct increment_iterator -{ - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE void operator()(Iterator& it) - { - ++it; - } -}; // end increment_iterator - -struct decrement_iterator -{ - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE void operator()(Iterator& it) - { - --it; - } -}; // end decrement_iterator - -struct dereference_iterator -{ - template - struct apply - { - using type = thrust::detail::it_reference_t; - }; // end apply - - // XXX silence warnings of the form "calling a __host__ function from a __host__ __device__ function is not allowed - THRUST_EXEC_CHECK_DISABLE - template - THRUST_HOST_DEVICE typename apply::type operator()(Iterator const& it) - { - return *it; - } -}; // end dereference_iterator - -// The namespace tuple_impl_specific provides two meta- -// algorithms and two algorithms for tuples. -namespace tuple_impl_specific -{ - -// define apply1 for tuple_meta_transform_impl -template -struct apply1 : UnaryMetaFunctionClass::template apply -{}; // end apply1 - -// define apply2 for tuple_meta_accumulate_impl -template -struct apply2 : UnaryMetaFunctionClass::template apply -{}; // end apply2 - -// Meta-accumulate algorithm for tuples. Note: The template -// parameter StartType corresponds to the initial value in -// ordinary accumulation. -// -template -struct tuple_meta_accumulate; - -template -struct tuple_meta_accumulate, BinaryMetaFun, StartType> -{ - using type = typename _THRUST_STD::type_identity::type; -}; - -template -struct tuple_meta_accumulate, BinaryMetaFun, StartType> -{ - using type = - typename apply2, BinaryMetaFun, StartType>::type>::type; -}; - -template -inline THRUST_HOST_DEVICE Fun tuple_for_each_helper(Fun f) -{ - return f; -} - -template -inline THRUST_HOST_DEVICE Fun tuple_for_each_helper(Fun f, T& t, Ts&... ts) -{ - f(t); - return tuple_for_each_helper(f, ts...); -} - -// for_each algorithm for tuples. - -template -inline THRUST_HOST_DEVICE Fun tuple_for_each(thrust::tuple& t, Fun f, thrust::index_sequence) -{ - return tuple_for_each_helper(f, thrust::get(t)...); -} // end tuple_for_each() - -// for_each algorithm for tuples. -template -inline THRUST_HOST_DEVICE Fun tuple_for_each(thrust::tuple& t, Fun f) -{ - return tuple_for_each(t, f, thrust::make_index_sequence>::value>{}); -} - -} // namespace tuple_impl_specific - -namespace internal -{ - -template -struct iterator_value -{ - using type = thrust::detail::it_value_t; -}; - -} // namespace internal - -// Metafunction to obtain the type of the tuple whose element types -// are the value_types of an iterator tuple. -// -template -struct tuple_of_value_types : tuple_meta_transform -{}; // end tuple_of_value_types - -struct minimum_category_lambda -{ - template - struct apply : minimum_category - {}; -}; - -// Metafunction to obtain the minimal traversal tag in a tuple -// of iterators. -// -template -struct minimum_traversal_category_in_iterator_tuple -{ - using tuple_of_traversal_tags = typename tuple_meta_transform::type; - - using type = typename tuple_impl_specific:: - tuple_meta_accumulate::type; -}; - -struct minimum_system_lambda -{ - template - struct apply : minimum_system - {}; -}; - -// Metafunction to obtain the minimal system tag in a tuple -// of iterators. -template -struct minimum_system_in_iterator_tuple -{ - using tuple_of_system_tags = - typename thrust::detail::tuple_meta_transform::type; - - using type = typename tuple_impl_specific:: - tuple_meta_accumulate::type; -}; - -namespace zip_iterator_base_ns -{ - -template -struct tuple_of_iterator_references_helper; - -template -struct tuple_of_iterator_references_helper> -{ - using type = thrust::detail::tuple_of_iterator_references::type...>; -}; - -template -struct iterator_reference -{ - using type = typename ::std::iterator_traits::reference; -}; - -template -struct tuple_of_iterator_references -{ - // get a thrust::tuple of the iterators' references - using tuple_of_references = typename tuple_meta_transform::type; - - // map thrust::tuple to tuple_of_iterator_references - using type = typename tuple_of_iterator_references_helper< - tuple_of_references, - thrust::make_index_sequence::value>>::type; -}; - -} // namespace zip_iterator_base_ns - -/////////////////////////////////////////////////////////////////// -// -// Class make_zip_iterator_base -// -// Builds and exposes the iterator facade type from which the zip -// iterator will be derived. -// -template -struct make_zip_iterator_base -{ - // private: - // reference type is the type of the tuple obtained from the - // iterators' reference types. - using reference = typename zip_iterator_base_ns::tuple_of_iterator_references::type; - - // Boost's Value type is the same as reference type. - // using value_type = reference; - using value_type = typename tuple_of_value_types::type; - - // Difference type is the first iterator's difference type - using difference_type = thrust::detail::it_difference_t::type>; - - // Iterator system is the minimum system tag in the - // iterator tuple - using system = typename minimum_system_in_iterator_tuple::type; - - // Traversal category is the minimum traversal category in the - // iterator tuple - using traversal_category = typename minimum_traversal_category_in_iterator_tuple::type; - -public: - // The iterator facade type from which the zip iterator will - // be derived. - using type = thrust:: - iterator_facade, value_type, system, traversal_category, reference, difference_type>; -}; // end make_zip_iterator_base - -namespace internal -{ - -template - class UnaryMetaFunction, - typename UnaryFunction, - typename IndexSequence = thrust::make_index_sequence::value>> -struct tuple_transform_functor; - -template class UnaryMetaFunction, typename UnaryFunction, size_t... Is> -struct tuple_transform_functor> -{ - static THRUST_HOST_DEVICE typename tuple_meta_transform::type - do_it_on_the_host_or_device(const Tuple& t, UnaryFunction f) - { - using XfrmTuple = typename tuple_meta_transform::type; - - return XfrmTuple(f(thrust::get(t))...); - } -}; - -template