From 91b78d8f817428939b7ff68a149d124344bc5d12 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Mon, 1 Jul 2024 16:16:17 +0200 Subject: [PATCH] Replace typedef by alias declarations in Thrust (#1915) Using: * clang-tidy modernize-use-using * regex replace: "typedef ([\w<>,:\s*&+:\[\]\.]+)\s+([\w_]+);" by "using $2 = $1;" * manual search and edits Fixes a part of: #1747 --- thrust/examples/bucket_sort2d.cu | 2 +- thrust/examples/counting_iterator.cu | 2 +- .../cuda/custom_temporary_allocation.cu | 6 +- thrust/examples/cuda/global_device_vector.cu | 5 +- thrust/examples/cuda/range_view.cu | 10 +- thrust/examples/dot_products_with_zip.cu | 8 +- thrust/examples/expand.cu | 4 +- thrust/examples/histogram.cu | 10 +- thrust/examples/mr_basic.cu | 19 +- thrust/examples/padded_grid_reduction.cu | 8 +- thrust/examples/raw_reference_cast.cu | 8 +- thrust/examples/repeated_range.cu | 12 +- thrust/examples/simple_moving_average.cu | 2 +- thrust/examples/sparse_vector.cu | 4 +- thrust/examples/stream_compaction.cu | 6 +- thrust/examples/strided_range.cu | 12 +- thrust/examples/summary_statistics.cu | 4 +- thrust/examples/tiled_range.cu | 12 +- thrust/examples/transform_iterator.cu | 16 +- thrust/examples/uninitialized_vector.cu | 4 +- thrust/examples/weld_vertices.cu | 2 +- thrust/testing/adjacent_difference.cu | 2 +- thrust/testing/advance.cu | 12 +- thrust/testing/alignment.cu | 2 +- thrust/testing/allocator.cu | 11 +- thrust/testing/allocator_aware_policies.cu | 14 +- thrust/testing/binary_search_descending.cu | 8 +- thrust/testing/binary_search_vector.cu | 32 ++-- .../binary_search_vector_descending.cu | 34 ++-- thrust/testing/caching_allocator.cu | 4 +- thrust/testing/complex_transform.cu | 10 +- thrust/testing/constant_iterator.cu | 8 +- thrust/testing/copy.cu | 34 ++-- thrust/testing/copy_n.cu | 14 +- thrust/testing/count.cu | 2 +- thrust/testing/counting_iterator.cu | 6 +- thrust/testing/cuda/binary_search.cu | 6 +- thrust/testing/cuda/copy_if.cu | 6 +- thrust/testing/cuda/find.cu | 6 +- thrust/testing/cuda/is_sorted_until.cu | 8 +- thrust/testing/cuda/logical.cu | 18 +- thrust/testing/cuda/max_element.cu | 10 +- thrust/testing/cuda/memory.cu | 6 +- thrust/testing/cuda/merge_by_key.cu | 6 +- thrust/testing/cuda/merge_sort.cu | 14 +- thrust/testing/cuda/min_element.cu | 10 +- thrust/testing/cuda/minmax_element.cu | 10 +- thrust/testing/cuda/mismatch.cu | 6 +- thrust/testing/cuda/pair_sort.cu | 2 +- thrust/testing/cuda/pair_sort_by_key.cu | 2 +- thrust/testing/cuda/partition.cu | 46 ++--- thrust/testing/cuda/partition_point.cu | 8 +- thrust/testing/cuda/reduce.cu | 2 +- thrust/testing/cuda/reduce_by_key.cu | 11 +- thrust/testing/cuda/remove.cu | 36 ++-- thrust/testing/cuda/replace.cu | 4 +- thrust/testing/cuda/reverse.cu | 4 +- thrust/testing/cuda/scan.cu | 4 +- thrust/testing/cuda/scan_by_key.cu | 12 +- thrust/testing/cuda/scatter.cu | 4 +- thrust/testing/cuda/sequence.cu | 2 +- thrust/testing/cuda/set_difference.cu | 8 +- thrust/testing/cuda/set_difference_by_key.cu | 10 +- thrust/testing/cuda/set_intersection.cu | 8 +- .../testing/cuda/set_intersection_by_key.cu | 10 +- .../testing/cuda/set_symmetric_difference.cu | 8 +- .../cuda/set_symmetric_difference_by_key.cu | 10 +- thrust/testing/cuda/set_union.cu | 8 +- thrust/testing/cuda/set_union_by_key.cu | 8 +- thrust/testing/cuda/swap_ranges.cu | 4 +- thrust/testing/cuda/tabulate.cu | 8 +- thrust/testing/cuda/transform.cu | 28 +-- thrust/testing/cuda/transform_reduce.cu | 8 +- thrust/testing/cuda/transform_scan.cu | 12 +- thrust/testing/cuda/uninitialized_copy.cu | 8 +- thrust/testing/cuda/uninitialized_fill.cu | 16 +- thrust/testing/cuda/unique.cu | 24 +-- thrust/testing/cuda/unique_by_key.cu | 24 +-- thrust/testing/dependencies_aware_policies.cu | 10 +- thrust/testing/device_ptr.cu | 4 +- thrust/testing/device_reference.cu | 12 +- thrust/testing/discard_iterator.cu | 8 +- thrust/testing/distance.cu | 2 +- thrust/testing/docs/doxybook_test.h | 2 +- thrust/testing/equal.cu | 2 +- thrust/testing/fill.cu | 14 +- thrust/testing/find.cu | 4 +- thrust/testing/for_each.cu | 4 +- thrust/testing/functional.cu | 22 +-- thrust/testing/functional_arithmetic.cu | 4 +- thrust/testing/functional_bitwise.cu | 4 +- thrust/testing/functional_logical.cu | 4 +- .../functional_placeholders_arithmetic.cu | 10 +- .../functional_placeholders_bitwise.cu | 22 +-- ...tional_placeholders_compound_assignment.cu | 14 +- .../functional_placeholders_logical.cu | 24 +-- .../functional_placeholders_miscellaneous.cu | 4 +- .../functional_placeholders_relational.cu | 18 +- thrust/testing/generate.cu | 10 +- thrust/testing/inner_product.cu | 4 +- thrust/testing/is_partitioned.cu | 4 +- thrust/testing/is_sorted.cu | 4 +- thrust/testing/is_sorted_until.cu | 6 +- thrust/testing/logical.cu | 6 +- thrust/testing/max_element.cu | 4 +- thrust/testing/memory.cu | 24 +-- thrust/testing/min_and_max.cu | 4 +- thrust/testing/min_element.cu | 4 +- thrust/testing/minmax_element.cu | 4 +- thrust/testing/mr_disjoint_pool.cu | 8 +- thrust/testing/mr_pool.cu | 12 +- thrust/testing/omp/nvcc_independence.cpp | 8 +- thrust/testing/omp/reduce_intervals.cu | 8 +- thrust/testing/pair.cu | 6 +- thrust/testing/pair_reduce.cu | 2 +- thrust/testing/pair_scan.cu | 2 +- thrust/testing/pair_scan_by_key.cu | 2 +- thrust/testing/pair_sort.cu | 2 +- thrust/testing/pair_sort_by_key.cu | 2 +- thrust/testing/pair_transform.cu | 2 +- thrust/testing/partition.cu | 50 +++--- thrust/testing/partition_point.cu | 8 +- thrust/testing/permutation_iterator.cu | 32 ++-- thrust/testing/random.cu | 126 +++++++------- thrust/testing/reduce.cu | 4 +- thrust/testing/reduce_by_key.cu | 18 +- thrust/testing/remove.cu | 20 +-- thrust/testing/replace.cu | 12 +- thrust/testing/reverse.cu | 4 +- thrust/testing/reverse_iterator.cu | 2 +- thrust/testing/scan.cu | 14 +- thrust/testing/scan_by_key.exclusive.cu | 6 +- thrust/testing/scan_by_key.inclusive.cu | 8 +- thrust/testing/set_difference.cu | 2 +- thrust/testing/set_difference_by_key.cu | 2 +- .../set_difference_by_key_descending.cu | 4 +- thrust/testing/set_difference_descending.cu | 4 +- thrust/testing/set_difference_key_value.cu | 2 +- thrust/testing/set_intersection.cu | 2 +- thrust/testing/set_intersection_by_key.cu | 2 +- .../set_intersection_by_key_descending.cu | 4 +- thrust/testing/set_intersection_descending.cu | 4 +- thrust/testing/set_intersection_key_value.cu | 2 +- thrust/testing/set_symmetric_difference.cu | 4 +- .../set_symmetric_difference_by_key.cu | 2 +- ..._symmetric_difference_by_key_descending.cu | 4 +- .../set_symmetric_difference_descending.cu | 4 +- thrust/testing/set_union.cu | 4 +- thrust/testing/set_union_by_key.cu | 2 +- thrust/testing/set_union_by_key_descending.cu | 4 +- thrust/testing/set_union_descending.cu | 4 +- thrust/testing/set_union_key_value.cu | 4 +- thrust/testing/shuffle.cu | 8 +- thrust/testing/sort_by_key_variable_bits.cu | 11 +- thrust/testing/sort_permutation_iterator.cu | 18 +- thrust/testing/sort_variable_bits.cu | 11 +- thrust/testing/stable_sort.cu | 4 +- thrust/testing/stable_sort_by_key.cu | 2 +- thrust/testing/tabulate.cu | 2 +- thrust/testing/transform.cu | 24 +-- .../transform_input_output_iterator.cu | 14 +- thrust/testing/transform_iterator.cu | 12 +- thrust/testing/transform_output_iterator.cu | 10 +- thrust/testing/transform_reduce.cu | 6 +- thrust/testing/transform_scan.cu | 6 +- thrust/testing/trivial_sequence.cu | 6 +- thrust/testing/tuple.cu | 2 +- thrust/testing/type_traits.cu | 94 +++++----- thrust/testing/uninitialized_copy.cu | 8 +- thrust/testing/uninitialized_fill.cu | 8 +- thrust/testing/unique.cu | 6 +- thrust/testing/unique_by_key.cu | 34 ++-- thrust/testing/unittest/assertions.h | 12 +- thrust/testing/unittest/meta.h | 26 +-- .../testing/unittest/runtime_static_assert.h | 6 +- thrust/testing/unittest/testframework.cu | 2 +- thrust/testing/unittest/testframework.h | 49 +++--- thrust/testing/vector.cu | 30 ++-- thrust/testing/vector_allocators.cu | 44 ++--- thrust/testing/vector_insert.cu | 4 +- thrust/testing/vector_manipulation.cu | 4 +- thrust/testing/zip_iterator.cu | 122 ++++++------- thrust/testing/zip_iterator_reduce.cu | 2 +- thrust/testing/zip_iterator_reduce_by_key.cu | 2 +- thrust/testing/zip_iterator_scan.cu | 2 +- thrust/thrust/complex.h | 2 +- thrust/thrust/detail/adjacent_difference.inl | 8 +- .../detail/allocator/allocator_traits.h | 163 +++++++++--------- .../detail/allocator/allocator_traits.inl | 14 +- .../detail/allocator/copy_construct_range.inl | 16 +- .../detail/allocator/malloc_allocator.h | 6 +- .../detail/allocator/no_throw_allocator.h | 4 +- .../detail/allocator/tagged_allocator.h | 32 ++-- .../detail/allocator/temporary_allocator.h | 8 +- .../detail/allocator_aware_execution_policy.h | 8 +- thrust/thrust/detail/binary_search.inl | 52 +++--- thrust/thrust/detail/complex/math_private.h | 8 +- .../thrust/detail/config/global_workarounds.h | 2 +- thrust/thrust/detail/contiguous_storage.h | 24 +-- thrust/thrust/detail/copy.inl | 8 +- thrust/thrust/detail/copy_if.inl | 10 +- thrust/thrust/detail/count.inl | 4 +- thrust/thrust/detail/cstdint.h | 56 +++--- thrust/thrust/detail/device_free.inl | 2 +- thrust/thrust/detail/device_malloc.inl | 4 +- thrust/thrust/detail/equal.inl | 8 +- thrust/thrust/detail/execute_with_allocator.h | 44 ++--- .../detail/execute_with_allocator_fwd.h | 2 +- thrust/thrust/detail/extrema.inl | 12 +- thrust/thrust/detail/fill.inl | 4 +- thrust/thrust/detail/find.inl | 6 +- thrust/thrust/detail/for_each.inl | 4 +- thrust/thrust/detail/functional.inl | 72 ++++---- thrust/thrust/detail/functional/actor.h | 22 ++- thrust/thrust/detail/functional/argument.h | 4 +- thrust/thrust/detail/functional/composite.h | 6 +- .../operators/assignment_operator.h | 2 +- thrust/thrust/detail/functional/placeholder.h | 2 +- thrust/thrust/detail/functional/value.h | 2 +- thrust/thrust/detail/gather.inl | 22 +-- thrust/thrust/detail/generate.inl | 4 +- thrust/thrust/detail/inner_product.inl | 8 +- thrust/thrust/detail/internal_functional.h | 18 +- thrust/thrust/detail/logical.inl | 6 +- thrust/thrust/detail/memory_algorithms.h | 19 +- thrust/thrust/detail/merge.inl | 36 ++-- thrust/thrust/detail/mismatch.inl | 8 +- thrust/thrust/detail/numeric_traits.h | 17 +- thrust/thrust/detail/overlapped_copy.h | 8 +- thrust/thrust/detail/partition.inl | 44 ++--- thrust/thrust/detail/pointer.h | 42 ++--- thrust/thrust/detail/pointer.inl | 4 +- thrust/thrust/detail/range/head_flags.h | 20 +-- thrust/thrust/detail/range/tail_flags.h | 6 +- thrust/thrust/detail/raw_pointer_cast.h | 4 +- thrust/thrust/detail/raw_reference_cast.h | 18 +- thrust/thrust/detail/reduce.inl | 30 ++-- thrust/thrust/detail/remove.inl | 22 +-- thrust/thrust/detail/replace.inl | 22 +-- thrust/thrust/detail/reverse.inl | 6 +- thrust/thrust/detail/scan.inl | 62 +++---- thrust/thrust/detail/scatter.inl | 22 +-- thrust/thrust/detail/sequence.inl | 6 +- thrust/thrust/detail/set_operations.inl | 140 +++++++-------- thrust/thrust/detail/shuffle.inl | 6 +- thrust/thrust/detail/sort.inl | 32 ++-- thrust/thrust/detail/static_map.h | 5 +- thrust/thrust/detail/swap_ranges.inl | 4 +- thrust/thrust/detail/tabulate.inl | 2 +- thrust/thrust/detail/temporary_array.h | 10 +- thrust/thrust/detail/temporary_buffer.h | 4 +- thrust/thrust/detail/transform.inl | 28 +-- thrust/thrust/detail/transform_reduce.inl | 2 +- thrust/thrust/detail/transform_scan.inl | 8 +- thrust/thrust/detail/trivial_sequence.h | 8 +- thrust/thrust/detail/tuple_meta_transform.h | 6 +- thrust/thrust/detail/tuple_transform.h | 4 +- thrust/thrust/detail/type_traits.h | 10 +- .../detail/type_traits/function_traits.h | 2 +- .../detail/type_traits/has_nested_type.h | 24 +-- .../detail/type_traits/is_call_possible.h | 8 +- .../thrust/detail/type_traits/minimum_type.h | 8 +- .../detail/type_traits/pointer_traits.h | 68 ++++---- thrust/thrust/detail/uninitialized_copy.inl | 8 +- thrust/thrust/detail/uninitialized_fill.inl | 4 +- thrust/thrust/detail/unique.inl | 40 ++--- thrust/thrust/detail/vector_base.h | 32 ++-- thrust/thrust/detail/vector_base.inl | 16 +- thrust/thrust/device_allocator.h | 8 +- thrust/thrust/device_malloc_allocator.h | 18 +- thrust/thrust/device_new_allocator.h | 18 +- thrust/thrust/device_reference.h | 6 +- thrust/thrust/device_vector.h | 6 +- thrust/thrust/execution_policy.h | 4 +- thrust/thrust/functional.h | 152 ++++++++-------- thrust/thrust/host_vector.h | 6 +- thrust/thrust/iterator/constant_iterator.h | 10 +- thrust/thrust/iterator/counting_iterator.h | 14 +- .../iterator/detail/constant_iterator_base.h | 27 ++- .../iterator/detail/counting_iterator.inl | 34 ++-- .../iterator/detail/device_system_tag.h | 2 +- .../iterator/detail/discard_iterator_base.h | 23 ++- .../thrust/iterator/detail/host_system_tag.h | 2 +- .../iterator/detail/iterator_adaptor_base.h | 19 +- ...rator_category_with_system_and_traversal.h | 4 +- .../detail/iterator_facade_category.h | 17 +- .../iterator/detail/iterator_traits.inl | 12 +- thrust/thrust/iterator/detail/join_iterator.h | 34 ++-- .../thrust/iterator/detail/normal_iterator.h | 2 +- .../detail/permutation_iterator_base.h | 20 +-- .../iterator/detail/reverse_iterator_base.h | 2 +- .../thrust/iterator/detail/tagged_iterator.h | 18 +- .../transform_input_output_iterator.inl | 14 +- .../iterator/detail/transform_iterator.inl | 26 +-- .../detail/transform_output_iterator.inl | 14 +- .../detail/tuple_of_iterator_references.h | 2 +- .../iterator/detail/zip_iterator_base.h | 50 +++--- thrust/thrust/iterator/discard_iterator.h | 10 +- thrust/thrust/iterator/iterator_adaptor.h | 14 +- thrust/thrust/iterator/iterator_categories.h | 10 +- thrust/thrust/iterator/iterator_facade.h | 12 +- thrust/thrust/iterator/permutation_iterator.h | 6 +- thrust/thrust/iterator/reverse_iterator.h | 6 +- .../transform_input_output_iterator.h | 2 +- thrust/thrust/iterator/transform_iterator.h | 8 +- .../iterator/transform_output_iterator.h | 4 +- thrust/thrust/iterator/zip_iterator.h | 4 +- thrust/thrust/memory.h | 10 +- thrust/thrust/mismatch.h | 8 +- thrust/thrust/mr/allocator.h | 32 ++-- thrust/thrust/mr/device_memory_resource.h | 8 +- thrust/thrust/mr/disjoint_pool.h | 14 +- thrust/thrust/mr/disjoint_sync_pool.h | 6 +- thrust/thrust/mr/host_memory_resource.h | 2 +- thrust/thrust/mr/memory_resource.h | 4 +- thrust/thrust/mr/pool.h | 16 +- thrust/thrust/mr/sync_pool.h | 6 +- thrust/thrust/per_device_resource.h | 6 +- thrust/thrust/random.h | 22 +-- .../random/detail/discard_block_engine.inl | 8 +- .../detail/linear_congruential_engine.inl | 8 +- .../linear_congruential_engine_discard.h | 2 +- .../detail/linear_feedback_shift_engine.inl | 8 +- .../random/detail/normal_distribution.inl | 8 +- .../random/detail/normal_distribution_base.h | 4 +- .../detail/subtract_with_carry_engine.inl | 8 +- .../detail/uniform_int_distribution.inl | 10 +- .../detail/uniform_real_distribution.inl | 8 +- .../random/detail/xor_combine_engine.inl | 8 +- .../random/detail/xor_combine_engine_max.h | 8 +- thrust/thrust/random/discard_block_engine.h | 4 +- .../random/linear_congruential_engine.h | 6 +- .../random/linear_feedback_shift_engine.h | 2 +- thrust/thrust/random/normal_distribution.h | 6 +- .../random/subtract_with_carry_engine.h | 6 +- .../thrust/random/uniform_int_distribution.h | 4 +- .../thrust/random/uniform_real_distribution.h | 4 +- thrust/thrust/random/xor_combine_engine.h | 8 +- .../system/cpp/detail/execution_policy.h | 2 +- thrust/thrust/system/cpp/memory_resource.h | 12 +- .../system/cuda/detail/adjacent_difference.h | 2 +- .../system/cuda/detail/core/agent_launcher.h | 4 +- .../cuda/detail/core/triple_chevron_launch.h | 2 +- thrust/thrust/system/cuda/detail/core/util.h | 43 +++-- thrust/thrust/system/cuda/detail/count.h | 4 +- .../thrust/system/cuda/detail/cross_system.h | 4 +- thrust/thrust/system/cuda/detail/equal.h | 2 +- .../system/cuda/detail/execution_policy.h | 4 +- thrust/thrust/system/cuda/detail/extrema.h | 38 ++-- thrust/thrust/system/cuda/detail/find.h | 8 +- thrust/thrust/system/cuda/detail/for_each.h | 2 +- thrust/thrust/system/cuda/detail/get_value.h | 2 +- .../thrust/system/cuda/detail/inner_product.h | 6 +- .../cuda/detail/internal/copy_cross_system.h | 6 +- .../detail/internal/copy_device_to_device.h | 6 +- .../cuda/detail/make_unsigned_special.h | 6 +- thrust/thrust/system/cuda/detail/merge.h | 103 ++++++----- thrust/thrust/system/cuda/detail/mismatch.h | 4 +- thrust/thrust/system/cuda/detail/par.h | 12 +- thrust/thrust/system/cuda/detail/par_to_seq.h | 10 +- thrust/thrust/system/cuda/detail/reduce.h | 106 ++++++------ .../thrust/system/cuda/detail/reduce_by_key.h | 82 ++++----- thrust/thrust/system/cuda/detail/replace.h | 8 +- thrust/thrust/system/cuda/detail/reverse.h | 2 +- .../system/cuda/detail/set_operations.h | 109 ++++++------ thrust/thrust/system/cuda/detail/sort.h | 10 +- .../thrust/system/cuda/detail/swap_ranges.h | 6 +- thrust/thrust/system/cuda/detail/tabulate.h | 4 +- thrust/thrust/system/cuda/detail/transform.h | 8 +- .../system/cuda/detail/transform_reduce.h | 2 +- .../system/cuda/detail/transform_scan.h | 12 +- .../system/cuda/detail/uninitialized_copy.h | 6 +- .../system/cuda/detail/uninitialized_fill.h | 4 +- thrust/thrust/system/cuda/detail/unique.h | 62 +++---- .../thrust/system/cuda/detail/unique_by_key.h | 4 +- thrust/thrust/system/cuda/detail/util.h | 36 ++-- thrust/thrust/system/cuda/memory_resource.h | 20 +-- .../detail/generic/adjacent_difference.inl | 4 +- .../system/detail/generic/binary_search.inl | 8 +- thrust/thrust/system/detail/generic/copy.inl | 12 +- .../thrust/system/detail/generic/copy_if.inl | 2 +- thrust/thrust/system/detail/generic/count.inl | 4 +- thrust/thrust/system/detail/generic/equal.inl | 2 +- .../thrust/system/detail/generic/extrema.inl | 18 +- thrust/thrust/system/detail/generic/find.inl | 10 +- .../thrust/system/detail/generic/gather.inl | 4 +- .../system/detail/generic/inner_product.inl | 2 +- thrust/thrust/system/detail/generic/merge.inl | 16 +- .../thrust/system/detail/generic/mismatch.inl | 4 +- .../system/detail/generic/partition.inl | 4 +- .../thrust/system/detail/generic/reduce.inl | 2 +- .../system/detail/generic/reduce_by_key.inl | 14 +- .../thrust/system/detail/generic/remove.inl | 4 +- .../thrust/system/detail/generic/replace.inl | 4 +- .../thrust/system/detail/generic/reverse.inl | 2 +- .../system/detail/generic/scan_by_key.inl | 4 +- .../thrust/system/detail/generic/scatter.inl | 4 +- .../detail/generic/select_system_exists.h | 4 +- .../thrust/system/detail/generic/sequence.inl | 2 +- .../system/detail/generic/set_operations.inl | 68 ++++---- thrust/thrust/system/detail/generic/sort.inl | 14 +- .../system/detail/generic/swap_ranges.inl | 4 +- .../thrust/system/detail/generic/tabulate.inl | 2 +- .../system/detail/generic/transform.inl | 30 ++-- .../detail/generic/uninitialized_copy.inl | 24 +-- .../detail/generic/uninitialized_fill.inl | 12 +- .../thrust/system/detail/generic/unique.inl | 8 +- .../system/detail/generic/unique_by_key.inl | 10 +- .../thrust/system/detail/internal/decompose.h | 6 +- .../detail/sequential/adjacent_difference.h | 2 +- .../system/detail/sequential/binary_search.h | 4 +- .../thrust/system/detail/sequential/copy.inl | 2 +- .../system/detail/sequential/general_copy.h | 2 +- .../system/detail/sequential/insertion_sort.h | 6 +- .../system/detail/sequential/partition.h | 14 +- .../system/detail/sequential/reduce_by_key.h | 4 +- .../thrust/system/detail/sequential/sort.inl | 4 +- .../detail/sequential/stable_merge_sort.inl | 16 +- .../detail/sequential/stable_radix_sort.inl | 26 +-- .../thrust/system/detail/sequential/unique.h | 4 +- .../system/detail/sequential/unique_by_key.h | 4 +- thrust/thrust/system/omp/detail/copy.inl | 12 +- .../system/omp/detail/execution_policy.h | 2 +- thrust/thrust/system/omp/detail/for_each.inl | 2 +- thrust/thrust/system/omp/detail/reduce.inl | 2 +- .../system/omp/detail/reduce_intervals.inl | 4 +- thrust/thrust/system/omp/detail/sort.inl | 10 +- thrust/thrust/system/omp/memory_resource.h | 12 +- thrust/thrust/system/tbb/detail/copy.inl | 12 +- thrust/thrust/system/tbb/detail/copy_if.inl | 4 +- .../system/tbb/detail/execution_policy.h | 2 +- thrust/thrust/system/tbb/detail/merge.inl | 17 +- thrust/thrust/system/tbb/detail/reduce.inl | 4 +- .../system/tbb/detail/reduce_by_key.inl | 12 +- .../system/tbb/detail/reduce_intervals.h | 4 +- thrust/thrust/system/tbb/detail/scan.inl | 4 +- thrust/thrust/system/tbb/detail/sort.inl | 16 +- thrust/thrust/system/tbb/memory_resource.h | 12 +- 438 files changed, 2885 insertions(+), 2918 deletions(-) diff --git a/thrust/examples/bucket_sort2d.cu b/thrust/examples/bucket_sort2d.cu index 9d1d2561083..aac7147411e 100644 --- a/thrust/examples/bucket_sort2d.cu +++ b/thrust/examples/bucket_sort2d.cu @@ -12,7 +12,7 @@ #include "include/host_device.h" // define a 2d float vector -typedef thrust::tuple vec2; +using vec2 = thrust::tuple; // return a random vec2 in [0,1)^2 vec2 make_random_vec2() diff --git a/thrust/examples/counting_iterator.cu b/thrust/examples/counting_iterator.cu index c420b4d25e5..2979359b61d 100644 --- a/thrust/examples/counting_iterator.cu +++ b/thrust/examples/counting_iterator.cu @@ -29,7 +29,7 @@ int main() thrust::counting_iterator last = first + 8; // compute indices of nonzero elements - typedef thrust::device_vector::iterator IndexIterator; + using IndexIterator = thrust::device_vector::iterator; IndexIterator indices_end = thrust::copy_if(first, last, stencil.begin(), indices.begin(), thrust::identity()); // indices now contains [1,2,5,7] diff --git a/thrust/examples/cuda/custom_temporary_allocation.cu b/thrust/examples/cuda/custom_temporary_allocation.cu index 009397252f1..0eee3bbf3d1 100644 --- a/thrust/examples/cuda/custom_temporary_allocation.cu +++ b/thrust/examples/cuda/custom_temporary_allocation.cu @@ -49,7 +49,7 @@ private: // A simple allocator for caching cudaMalloc allocations. struct cached_allocator { - typedef char value_type; + using value_type = char; cached_allocator() {} @@ -120,8 +120,8 @@ struct cached_allocator } private: - typedef std::multimap free_blocks_type; - typedef std::map allocated_blocks_type; + using free_blocks_type = std::multimap; + using allocated_blocks_type = std::map; free_blocks_type free_blocks; allocated_blocks_type allocated_blocks; diff --git a/thrust/examples/cuda/global_device_vector.cu b/thrust/examples/cuda/global_device_vector.cu index 35c08c88615..822aaf35599 100644 --- a/thrust/examples/cuda/global_device_vector.cu +++ b/thrust/examples/cuda/global_device_vector.cu @@ -19,9 +19,8 @@ extern "C" cudaError_t cudaFreeIgnoreShutdown(void* ptr) return err; } -typedef thrust::system::cuda::detail:: - cuda_memory_resource> - device_ignore_shutdown_memory_resource; +using device_ignore_shutdown_memory_resource = + thrust::system::cuda::detail::cuda_memory_resource>; template using device_ignore_shutdown_allocator = diff --git a/thrust/examples/cuda/range_view.cu b/thrust/examples/cuda/range_view.cu index 10a65925619..b4c9a1dd286 100644 --- a/thrust/examples/cuda/range_view.cu +++ b/thrust/examples/cuda/range_view.cu @@ -19,11 +19,11 @@ template class range_view { public: - typedef Iterator iterator; - typedef typename thrust::iterator_traits::value_type value_type; - typedef typename thrust::iterator_traits::pointer pointer; - typedef typename thrust::iterator_traits::difference_type difference_type; - typedef typename thrust::iterator_traits::reference reference; + using iterator = Iterator; + using value_type = typename thrust::iterator_traits::value_type; + using pointer = typename thrust::iterator_traits::pointer; + using difference_type = typename thrust::iterator_traits::difference_type; + using reference = typename thrust::iterator_traits::reference; private: const iterator first; diff --git a/thrust/examples/dot_products_with_zip.cu b/thrust/examples/dot_products_with_zip.cu index 3c82994598f..c73189caf04 100644 --- a/thrust/examples/dot_products_with_zip.cu +++ b/thrust/examples/dot_products_with_zip.cu @@ -14,7 +14,7 @@ // into a single virtual Float3 array. // We'll use a 3-tuple to store our 3d vector type -typedef thrust::tuple Float3; +using Float3 = thrust::tuple; // This functor implements the dot product between 3d vectors struct DotProduct : public thrust::binary_function @@ -74,9 +74,9 @@ int main() // METHOD #1 // Defining a zip_iterator type can be a little cumbersome ... - typedef thrust::device_vector::iterator FloatIterator; - typedef thrust::tuple FloatIteratorTuple; - typedef thrust::zip_iterator Float3Iterator; + using FloatIterator = thrust::device_vector::iterator; + using FloatIteratorTuple = thrust::tuple; + using Float3Iterator = thrust::zip_iterator; // Now we'll create some zip_iterators for A and B Float3Iterator A_first = thrust::make_zip_iterator(thrust::make_tuple(A0.begin(), A1.begin(), A2.begin())); diff --git a/thrust/examples/expand.cu b/thrust/examples/expand.cu index c2d0984cb8a..ecded38ffd8 100644 --- a/thrust/examples/expand.cu +++ b/thrust/examples/expand.cu @@ -20,7 +20,7 @@ template OutputIterator expand(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator output) { - typedef typename thrust::iterator_difference::type difference_type; + using difference_type = typename thrust::iterator_difference::type; difference_type input_size = thrust::distance(first1, last1); difference_type output_size = thrust::reduce(first1, last1); @@ -53,7 +53,7 @@ OutputIterator expand(InputIterator1 first1, InputIterator1 last1, InputIterator template void print(const std::string& s, const Vector& v) { - typedef typename Vector::value_type T; + using T = typename Vector::value_type; std::cout << s; thrust::copy(v.begin(), v.end(), std::ostream_iterator(std::cout, " ")); diff --git a/thrust/examples/histogram.cu b/thrust/examples/histogram.cu index 660e390eb37..dc874667fe1 100644 --- a/thrust/examples/histogram.cu +++ b/thrust/examples/histogram.cu @@ -49,7 +49,7 @@ template void print_vector(const std::string& name, const Vector& v) { - typedef typename Vector::value_type T; + using T = typename Vector::value_type; std::cout << " " << std::setw(20) << name << " "; thrust::copy(v.begin(), v.end(), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; @@ -59,8 +59,8 @@ void print_vector(const std::string& name, const Vector& v) template void dense_histogram(const Vector1& input, Vector2& histogram) { - typedef typename Vector1::value_type ValueType; // input value type - typedef typename Vector2::value_type IndexType; // histogram index type + using ValueType = typename Vector1::value_type; // input value type + using IndexType = typename Vector2::value_type; // histogram index type // copy input data (could be skipped if input is allowed to be modified) thrust::device_vector data(input); @@ -98,8 +98,8 @@ void dense_histogram(const Vector1& input, Vector2& histogram) template void sparse_histogram(const Vector1& input, Vector2& histogram_values, Vector3& histogram_counts) { - typedef typename Vector1::value_type ValueType; // input value type - typedef typename Vector3::value_type IndexType; // histogram index type + using ValueType = typename Vector1::value_type; // input value type + using IndexType = typename Vector3::value_type; // histogram index type // copy input data (could be skipped if input is allowed to be modified) thrust::device_vector data(input); diff --git a/thrust/examples/mr_basic.cu b/thrust/examples/mr_basic.cu index 196b5222f31..7353b35dfe4 100644 --- a/thrust/examples/mr_basic.cu +++ b/thrust/examples/mr_basic.cu @@ -30,7 +30,7 @@ int main() { // no virtual calls will be issued - typedef thrust::mr::allocator Alloc; + using Alloc = thrust::mr::allocator; Alloc alloc(&memres); do_stuff_with_vector>(alloc); @@ -39,7 +39,7 @@ int main() { // virtual calls will be issued - wrapping in a polymorphic wrapper thrust::mr::polymorphic_adaptor_resource adaptor(&memres); - typedef thrust::mr::polymorphic_allocator Alloc; + using Alloc = thrust::mr::polymorphic_allocator; Alloc alloc(&adaptor); do_stuff_with_vector>(alloc); @@ -47,30 +47,29 @@ int main() { // use the global device_ptr-flavored device memory resource - typedef thrust::device_ptr_memory_resource Resource; + using Resource = thrust::device_ptr_memory_resource; thrust::mr::polymorphic_adaptor_resource> adaptor( thrust::mr::get_global_resource()); - typedef thrust::mr::polymorphic_allocator> Alloc; + using Alloc = thrust::mr::polymorphic_allocator>; Alloc alloc(&adaptor); do_stuff_with_vector>(alloc); } - typedef thrust::mr::unsynchronized_pool_resource Pool; + using Pool = thrust::mr::unsynchronized_pool_resource; Pool pool(&memres); { - typedef thrust::mr::allocator Alloc; + using Alloc = thrust::mr::allocator; Alloc alloc(&pool); do_stuff_with_vector>(alloc); } - typedef thrust::mr::disjoint_unsynchronized_pool_resource - DisjointPool; + using DisjointPool = + thrust::mr::disjoint_unsynchronized_pool_resource; DisjointPool disjoint_pool(&memres, &memres); { - typedef thrust::mr::allocator Alloc; + using Alloc = thrust::mr::allocator; Alloc alloc(&disjoint_pool); do_stuff_with_vector>(alloc); diff --git a/thrust/examples/padded_grid_reduction.cu b/thrust/examples/padded_grid_reduction.cu index b96a7b0e8f9..71694781ed0 100644 --- a/thrust/examples/padded_grid_reduction.cu +++ b/thrust/examples/padded_grid_reduction.cu @@ -24,8 +24,8 @@ template struct transform_tuple : public thrust::unary_function, thrust::tuple> { - typedef typename thrust::tuple InputTuple; - typedef typename thrust::tuple OutputTuple; + using InputTuple = typename thrust::tuple; + using OutputTuple = typename thrust::tuple; IndexType n, N; @@ -49,7 +49,7 @@ struct reduce_tuple thrust::tuple, thrust::tuple> { - typedef typename thrust::tuple Tuple; + using Tuple = typename thrust::tuple; __host__ __device__ Tuple operator()(const Tuple& t0, const Tuple& t1) const { @@ -108,7 +108,7 @@ int main() std::cout << "\n"; // compute min & max over valid region of the 2d grid - typedef thrust::tuple result_type; + using result_type = thrust::tuple; result_type init(true, FLT_MAX, -FLT_MAX); // initial value transform_tuple unary_op(n, N); // transformation operator diff --git a/thrust/examples/raw_reference_cast.cu b/thrust/examples/raw_reference_cast.cu index 148c9c71a0a..9f36344ba4f 100644 --- a/thrust/examples/raw_reference_cast.cu +++ b/thrust/examples/raw_reference_cast.cu @@ -70,7 +70,7 @@ struct copy_iterators template void print(const std::string& name, const Vector& v) { - typedef typename Vector::value_type T; + using T = typename Vector::value_type; std::cout << name << ": "; thrust::copy(v.begin(), v.end(), std::ostream_iterator(std::cout, " ")); @@ -79,9 +79,9 @@ void print(const std::string& name, const Vector& v) int main() { - typedef thrust::device_vector Vector; - typedef Vector::iterator Iterator; - typedef thrust::device_system_tag System; + using Vector = thrust::device_vector; + using Iterator = Vector::iterator; + using System = thrust::device_system_tag; // allocate device memory Vector A(5); diff --git a/thrust/examples/repeated_range.cu b/thrust/examples/repeated_range.cu index e859ea7d9af..0934744d4cb 100644 --- a/thrust/examples/repeated_range.cu +++ b/thrust/examples/repeated_range.cu @@ -21,7 +21,7 @@ template class repeated_range { public: - typedef typename thrust::iterator_difference::type difference_type; + using difference_type = typename thrust::iterator_difference::type; struct repeat_functor : public thrust::unary_function { @@ -37,12 +37,12 @@ public: } }; - typedef typename thrust::counting_iterator CountingIterator; - typedef typename thrust::transform_iterator TransformIterator; - typedef typename thrust::permutation_iterator PermutationIterator; + using CountingIterator = typename thrust::counting_iterator; + using TransformIterator = typename thrust::transform_iterator; + using PermutationIterator = typename thrust::permutation_iterator; // type of the repeated_range iterator - typedef PermutationIterator iterator; + using iterator = PermutationIterator; // construct repeated_range for the range [first,last) repeated_range(Iterator first, Iterator last, difference_type repeats) @@ -80,7 +80,7 @@ int main() thrust::copy(data.begin(), data.end(), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; - typedef thrust::device_vector::iterator Iterator; + using Iterator = thrust::device_vector::iterator; // create repeated_range with elements repeated twice repeated_range twice(data.begin(), data.end(), 2); diff --git a/thrust/examples/simple_moving_average.cu b/thrust/examples/simple_moving_average.cu index bb251bf06a3..a8efb675083 100644 --- a/thrust/examples/simple_moving_average.cu +++ b/thrust/examples/simple_moving_average.cu @@ -41,7 +41,7 @@ struct minus_and_divide : public thrust::binary_function template void simple_moving_average(const InputVector& data, size_t w, OutputVector& output) { - typedef typename InputVector::value_type T; + using T = typename InputVector::value_type; if (data.size() < w) { diff --git a/thrust/examples/sparse_vector.cu b/thrust/examples/sparse_vector.cu index 10e2b16e67b..928ce47653f 100644 --- a/thrust/examples/sparse_vector.cu +++ b/thrust/examples/sparse_vector.cu @@ -33,8 +33,8 @@ void sum_sparse_vectors( IndexVector3& C_index, ValueVector3& C_value) { - typedef typename IndexVector3::value_type IndexType; - typedef typename ValueVector3::value_type ValueType; + using IndexType = typename IndexVector3::value_type; + using ValueType = typename ValueVector3::value_type; assert(A_index.size() == A_value.size()); assert(B_index.size() == B_value.size()); diff --git a/thrust/examples/stream_compaction.cu b/thrust/examples/stream_compaction.cu index 191ef97ea68..5c63298d5df 100644 --- a/thrust/examples/stream_compaction.cu +++ b/thrust/examples/stream_compaction.cu @@ -23,7 +23,7 @@ struct is_odd : public thrust::unary_function template void print_range(const std::string& name, Iterator first, Iterator last) { - typedef typename std::iterator_traits::value_type T; + using T = typename std::iterator_traits::value_type; std::cout << name << ": "; thrust::copy(first, last, std::ostream_iterator(std::cout, " ")); @@ -36,8 +36,8 @@ int main() size_t N = 10; // define some types - typedef thrust::device_vector Vector; - typedef Vector::iterator Iterator; + using Vector = thrust::device_vector; + using Iterator = Vector::iterator; // allocate storage for array Vector values(N); diff --git a/thrust/examples/strided_range.cu b/thrust/examples/strided_range.cu index 0ef22c17110..6cc6c9782a3 100644 --- a/thrust/examples/strided_range.cu +++ b/thrust/examples/strided_range.cu @@ -21,7 +21,7 @@ template class strided_range { public: - typedef typename thrust::iterator_difference::type difference_type; + using difference_type = typename thrust::iterator_difference::type; struct stride_functor : public thrust::unary_function { @@ -37,12 +37,12 @@ public: } }; - typedef typename thrust::counting_iterator CountingIterator; - typedef typename thrust::transform_iterator TransformIterator; - typedef typename thrust::permutation_iterator PermutationIterator; + using CountingIterator = typename thrust::counting_iterator; + using TransformIterator = typename thrust::transform_iterator; + using PermutationIterator = typename thrust::permutation_iterator; // type of the strided_range iterator - typedef PermutationIterator iterator; + using iterator = PermutationIterator; // construct strided_range for the range [first,last) strided_range(Iterator first, Iterator last, difference_type stride) @@ -84,7 +84,7 @@ int main() thrust::copy(data.begin(), data.end(), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; - typedef thrust::device_vector::iterator Iterator; + using Iterator = thrust::device_vector::iterator; // create strided_range with indices [0,2,4,6] strided_range evens(data.begin(), data.end(), 2); diff --git a/thrust/examples/summary_statistics.cu b/thrust/examples/summary_statistics.cu index d5856851dd8..469501ac1c0 100644 --- a/thrust/examples/summary_statistics.cu +++ b/thrust/examples/summary_statistics.cu @@ -124,7 +124,7 @@ struct summary_stats_binary_op template void print_range(const std::string& name, Iterator first, Iterator last) { - typedef typename std::iterator_traits::value_type T; + using T = typename std::iterator_traits::value_type; std::cout << name << ": "; thrust::copy(first, last, std::ostream_iterator(std::cout, " ")); @@ -133,7 +133,7 @@ void print_range(const std::string& name, Iterator first, Iterator last) int main() { - typedef float T; + using T = float; // initialize host array T h_x[] = {4, 7, 13, 16}; diff --git a/thrust/examples/tiled_range.cu b/thrust/examples/tiled_range.cu index e0d8e9fef72..2fbef66c619 100644 --- a/thrust/examples/tiled_range.cu +++ b/thrust/examples/tiled_range.cu @@ -21,7 +21,7 @@ template class tiled_range { public: - typedef typename thrust::iterator_difference::type difference_type; + using difference_type = typename thrust::iterator_difference::type; struct tile_functor : public thrust::unary_function { @@ -37,12 +37,12 @@ public: } }; - typedef typename thrust::counting_iterator CountingIterator; - typedef typename thrust::transform_iterator TransformIterator; - typedef typename thrust::permutation_iterator PermutationIterator; + using CountingIterator = typename thrust::counting_iterator; + using TransformIterator = typename thrust::transform_iterator; + using PermutationIterator = typename thrust::permutation_iterator; // type of the tiled_range iterator - typedef PermutationIterator iterator; + using iterator = PermutationIterator; // construct repeated_range for the range [first,last) tiled_range(Iterator first, Iterator last, difference_type tiles) @@ -80,7 +80,7 @@ int main() thrust::copy(data.begin(), data.end(), std::ostream_iterator(std::cout, " ")); std::cout << std::endl; - typedef thrust::device_vector::iterator Iterator; + using Iterator = thrust::device_vector::iterator; // create tiled_range with two tiles tiled_range two(data.begin(), data.end(), 2); diff --git a/thrust/examples/transform_iterator.cu b/thrust/examples/transform_iterator.cu index e684105d607..4220d6d92d2 100644 --- a/thrust/examples/transform_iterator.cu +++ b/thrust/examples/transform_iterator.cu @@ -50,7 +50,7 @@ struct simple_negate : public thrust::unary_function template void print_range(const std::string& name, Iterator first, Iterator last) { - typedef typename std::iterator_traits::value_type T; + using T = typename std::iterator_traits::value_type; std::cout << name << ": "; thrust::copy(first, last, std::ostream_iterator(std::cout, " ")); @@ -64,8 +64,8 @@ int main() int hi = 5; // define some types - typedef thrust::device_vector Vector; - typedef Vector::iterator VectorIterator; + using Vector = thrust::device_vector; + using VectorIterator = Vector::iterator; // initialize values Vector values(8); @@ -82,7 +82,7 @@ int main() print_range("values ", values.begin(), values.end()); // define some more types - typedef thrust::transform_iterator, VectorIterator> ClampedVectorIterator; + using ClampedVectorIterator = thrust::transform_iterator, VectorIterator>; // create a transform_iterator that applies clamp() to the values array ClampedVectorIterator cv_begin = thrust::make_transform_iterator(values.begin(), clamp(lo, hi)); @@ -97,8 +97,8 @@ int main() //// // combine transform_iterator with other fancy iterators like counting_iterator - typedef thrust::counting_iterator CountingIterator; - typedef thrust::transform_iterator, CountingIterator> ClampedCountingIterator; + using CountingIterator = thrust::counting_iterator; + using ClampedCountingIterator = thrust::transform_iterator, CountingIterator>; CountingIterator count_begin(0); CountingIterator count_end(10); @@ -112,7 +112,7 @@ int main() //// // combine transform_iterator with another transform_iterator - typedef thrust::transform_iterator, ClampedCountingIterator> NegatedClampedCountingIterator; + using NegatedClampedCountingIterator = thrust::transform_iterator, ClampedCountingIterator>; NegatedClampedCountingIterator ncs_begin = thrust::make_transform_iterator(cs_begin, thrust::negate()); NegatedClampedCountingIterator ncs_end = thrust::make_transform_iterator(cs_end, thrust::negate()); @@ -121,7 +121,7 @@ int main() //// // when a functor does not define result_type, a third template argument must be provided - typedef thrust::transform_iterator, VectorIterator, int> NegatedVectorIterator; + using NegatedVectorIterator = thrust::transform_iterator, VectorIterator, int>; NegatedVectorIterator nv_begin(values.begin(), simple_negate()); NegatedVectorIterator nv_end(values.end(), simple_negate()); diff --git a/thrust/examples/uninitialized_vector.cu b/thrust/examples/uninitialized_vector.cu index d8b9290fb45..3f5a255657c 100644 --- a/thrust/examples/uninitialized_vector.cu +++ b/thrust/examples/uninitialized_vector.cu @@ -38,7 +38,7 @@ struct uninitialized_allocator : thrust::device_allocator template struct rebind { - typedef uninitialized_allocator other; + using other = uninitialized_allocator; }; // note that construct is annotated as @@ -51,7 +51,7 @@ struct uninitialized_allocator : thrust::device_allocator // to make a device_vector which does not initialize its elements, // use uninitialized_allocator as the 2nd template parameter -typedef thrust::device_vector> uninitialized_vector; +using uninitialized_vector = thrust::device_vector>; int main() { diff --git a/thrust/examples/weld_vertices.cu b/thrust/examples/weld_vertices.cu index 813881ea891..ff1bff568c2 100644 --- a/thrust/examples/weld_vertices.cu +++ b/thrust/examples/weld_vertices.cu @@ -34,7 +34,7 @@ */ // define a 2d float vector -typedef thrust::tuple vec2; +using vec2 = thrust::tuple; int main() { diff --git a/thrust/testing/adjacent_difference.cu b/thrust/testing/adjacent_difference.cu index a3a4c98c1fe..7b4473b1434 100644 --- a/thrust/testing/adjacent_difference.cu +++ b/thrust/testing/adjacent_difference.cu @@ -9,7 +9,7 @@ template void TestAdjacentDifferenceSimple() { - typedef typename Vector::value_type T; + using T = typename Vector::value_type; Vector input(4); Vector output(4); diff --git a/thrust/testing/advance.cu b/thrust/testing/advance.cu index 4a13ea3647c..fe7c14f76b9 100644 --- a/thrust/testing/advance.cu +++ b/thrust/testing/advance.cu @@ -8,8 +8,8 @@ template void TestAdvance() { - typedef typename Vector::value_type T; - typedef typename Vector::iterator Iterator; + using T = typename Vector::value_type; + using Iterator = typename Vector::iterator; Vector v(10); thrust::sequence(v.begin(), v.end()); @@ -33,8 +33,8 @@ DECLARE_VECTOR_UNITTEST(TestAdvance); template void TestNext() { - typedef typename Vector::value_type T; - typedef typename Vector::iterator Iterator; + using T = typename Vector::value_type; + using Iterator = typename Vector::iterator; Vector v(10); thrust::sequence(v.begin(), v.end()); @@ -64,8 +64,8 @@ DECLARE_VECTOR_UNITTEST(TestNext); template void TestPrev() { - typedef typename Vector::value_type T; - typedef typename Vector::iterator Iterator; + using T = typename Vector::value_type; + using Iterator = typename Vector::iterator; Vector v(10); thrust::sequence(v.begin(), v.end()); diff --git a/thrust/testing/alignment.cu b/thrust/testing/alignment.cu index 36ae00f0b11..f5d4d3e3675 100644 --- a/thrust/testing/alignment.cu +++ b/thrust/testing/alignment.cu @@ -125,7 +125,7 @@ DECLARE_UNITTEST(test_alignment_of); template void test_aligned_type_instantiation() { - typedef typename thrust::detail::aligned_type::type type; + using type = typename thrust::detail::aligned_type::type; ASSERT_GEQUAL(sizeof(type), 1lu); ASSERT_EQUAL(alignof(type), Align); ASSERT_EQUAL(thrust::detail::alignment_of::value, Align); diff --git a/thrust/testing/allocator.cu b/thrust/testing/allocator.cu index 533ae8cafd5..f76f001c025 100644 --- a/thrust/testing/allocator.cu +++ b/thrust/testing/allocator.cu @@ -112,7 +112,7 @@ struct my_allocator_with_custom_destroy return !(*this == other); } - typedef thrust::detail::true_type is_always_equal; + using is_always_equal = thrust::detail::true_type; // use composition rather than inheritance // to avoid inheriting std::allocator's member @@ -142,12 +142,11 @@ DECLARE_VARIABLE_UNITTEST(TestAllocatorCustomDestroy); template struct my_minimal_allocator { - typedef T value_type; + using value_type = T; - // XXX ideally, we shouldn't require - // these two typedefs - typedef T& reference; - typedef const T& const_reference; + // XXX ideally, we shouldn't require these two aliases + using reference = T&; + using const_reference = const T&; _CCCL_HOST my_minimal_allocator() {} diff --git a/thrust/testing/allocator_aware_policies.cu b/thrust/testing/allocator_aware_policies.cu index fbfb6ae0127..f85facf9325 100644 --- a/thrust/testing/allocator_aware_policies.cu +++ b/thrust/testing/allocator_aware_policies.cu @@ -32,12 +32,12 @@ struct test_memory_resource_t final : thrust::mr::memory_resource<> template class CRTPBase> struct policy_info { - typedef Policy policy; + using policy = Policy; template