From e32899a5d6cb0767e27ef230495ad4200999f57e Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 17 Jun 2021 14:02:39 -0400 Subject: [PATCH] Add ability to place Thrust in a custom namespace. This provides a workaround for downstream projects that encounter a variety of issues from dynamically linking multiple libraries that use Thrust. See the new `thrust/detail/config/namespace.h` header for details. Added several tests and checks to validate that this behavior is correct, and the `__THRUST_DEFINE_HAS_MEMBER_FUNCTION` utility has been rewritten to WAR an nvcc bug when the old implementation was used with objects in an anonymous namespace. New tests: - testing/namespace_wrapped.cu - testing/cmake/check_namespace.cmake --- cmake/ThrustHeaderTesting.cmake | 5 + dependencies/cub | 2 +- testing/cmake/CMakeLists.txt | 9 ++ testing/cmake/check_namespace.cmake | 88 +++++++++++++ testing/copy.cu | 7 +- testing/mr_disjoint_pool.cu | 8 +- testing/namespace_wrapped.cu | 43 +++++++ testing/scan.cu | 5 +- testing/unittest/assertions.h | 108 +++++++++------- testing/unittest/random.h | 54 ++++---- testing/unittest/special_types.h | 26 ++-- testing/unittest/testframework.h | 7 +- testing/unittest/util.h | 16 ++- thrust/addressof.h | 6 +- thrust/adjacent_difference.h | 6 +- thrust/advance.h | 5 +- thrust/allocate_unique.h | 5 +- thrust/async/copy.h | 5 +- thrust/async/for_each.h | 6 +- thrust/async/reduce.h | 5 +- thrust/async/scan.h | 5 +- thrust/async/sort.h | 5 +- thrust/async/transform.h | 6 +- thrust/binary_search.h | 7 +- thrust/complex.h | 5 +- thrust/copy.h | 7 +- thrust/count.h | 8 +- thrust/detail/adjacent_difference.inl | 7 +- thrust/detail/advance.inl | 6 +- thrust/detail/alignment.h | 6 +- thrust/detail/allocator/allocator_traits.h | 5 +- thrust/detail/allocator/allocator_traits.inl | 5 +- .../detail/allocator/copy_construct_range.h | 5 +- .../detail/allocator/copy_construct_range.inl | 5 +- .../allocator/default_construct_range.h | 5 +- .../allocator/default_construct_range.inl | 5 +- thrust/detail/allocator/destroy_range.h | 5 +- thrust/detail/allocator/destroy_range.inl | 5 +- .../detail/allocator/fill_construct_range.h | 5 +- .../detail/allocator/fill_construct_range.inl | 5 +- thrust/detail/allocator/malloc_allocator.h | 5 +- thrust/detail/allocator/malloc_allocator.inl | 5 +- thrust/detail/allocator/no_throw_allocator.h | 5 +- thrust/detail/allocator/tagged_allocator.h | 5 +- thrust/detail/allocator/tagged_allocator.inl | 5 +- thrust/detail/allocator/temporary_allocator.h | 5 +- .../detail/allocator/temporary_allocator.inl | 5 +- .../detail/allocator_aware_execution_policy.h | 8 +- thrust/detail/binary_search.inl | 7 +- thrust/detail/caching_allocator.h | 7 +- thrust/detail/complex/arithmetic.h | 5 +- thrust/detail/complex/c99math.h | 5 +- thrust/detail/complex/catrig.h | 4 +- thrust/detail/complex/catrigf.h | 4 +- thrust/detail/complex/ccosh.h | 4 +- thrust/detail/complex/ccoshf.h | 4 +- thrust/detail/complex/cexp.h | 4 +- thrust/detail/complex/cexpf.h | 4 +- thrust/detail/complex/clog.h | 4 +- thrust/detail/complex/clogf.h | 4 +- thrust/detail/complex/complex.inl | 5 +- thrust/detail/complex/cpow.h | 4 +- thrust/detail/complex/cproj.h | 5 +- thrust/detail/complex/csinh.h | 4 +- thrust/detail/complex/csinhf.h | 4 +- thrust/detail/complex/csqrt.h | 4 +- thrust/detail/complex/csqrtf.h | 4 +- thrust/detail/complex/ctanh.h | 4 +- thrust/detail/complex/ctanhf.h | 4 +- thrust/detail/complex/math_private.h | 4 +- thrust/detail/complex/stream.h | 5 +- thrust/detail/config/config.h | 1 + thrust/detail/config/memory_resource.h | 3 +- thrust/detail/config/namespace.h | 120 ++++++++++++++++++ thrust/detail/contiguous_storage.h | 5 +- thrust/detail/contiguous_storage.inl | 6 +- thrust/detail/copy.h | 7 +- thrust/detail/copy.inl | 8 +- thrust/detail/copy_if.h | 8 +- thrust/detail/copy_if.inl | 8 +- thrust/detail/count.inl | 8 +- thrust/detail/cstdint.h | 6 +- .../dependencies_aware_execution_policy.h | 7 +- thrust/detail/device_delete.inl | 7 +- thrust/detail/device_free.inl | 6 +- thrust/detail/device_malloc.inl | 8 +- thrust/detail/device_new.inl | 6 +- thrust/detail/device_ptr.inl | 5 +- thrust/detail/distance.inl | 8 +- thrust/detail/equal.inl | 8 +- thrust/detail/event_error.h | 5 +- thrust/detail/execute_with_allocator.h | 7 +- thrust/detail/execute_with_allocator_fwd.h | 8 +- thrust/detail/execute_with_dependencies.h | 8 +- thrust/detail/execution_policy.h | 7 +- thrust/detail/extrema.inl | 8 +- thrust/detail/fill.inl | 8 +- thrust/detail/find.inl | 26 ++-- thrust/detail/for_each.inl | 7 +- thrust/detail/function.h | 7 +- thrust/detail/functional.inl | 6 +- thrust/detail/functional/actor.h | 5 +- thrust/detail/functional/actor.inl | 5 +- thrust/detail/functional/argument.h | 5 +- thrust/detail/functional/composite.h | 5 +- .../operators/arithmetic_operators.h | 5 +- .../operators/assignment_operator.h | 5 +- .../functional/operators/bitwise_operators.h | 5 +- .../operators/compound_assignment_operators.h | 5 +- .../functional/operators/logical_operators.h | 5 +- .../functional/operators/operator_adaptors.h | 5 +- .../operators/relational_operators.h | 5 +- thrust/detail/functional/placeholder.h | 5 +- thrust/detail/functional/value.h | 5 +- thrust/detail/gather.inl | 8 +- thrust/detail/generate.inl | 8 +- thrust/detail/get_iterator_value.h | 6 +- thrust/detail/inner_product.inl | 8 +- thrust/detail/integer_math.h | 6 +- thrust/detail/integer_traits.h | 14 +- thrust/detail/internal_functional.h | 6 +- thrust/detail/logical.inl | 8 +- thrust/detail/malloc_and_free.h | 6 +- thrust/detail/memory_algorithms.h | 6 +- thrust/detail/merge.inl | 8 +- thrust/detail/minmax.h | 8 +- thrust/detail/mismatch.inl | 8 +- thrust/detail/mpl/math.h | 5 +- thrust/detail/numeric_traits.h | 6 +- thrust/detail/overlapped_copy.h | 6 +- thrust/detail/pair.inl | 7 +- thrust/detail/partition.inl | 8 +- thrust/detail/pointer.h | 16 +-- thrust/detail/pointer.inl | 8 +- thrust/detail/range/head_flags.h | 5 +- thrust/detail/range/tail_flags.h | 5 +- thrust/detail/raw_pointer_cast.h | 6 +- thrust/detail/raw_reference_cast.h | 5 +- thrust/detail/reduce.inl | 5 +- thrust/detail/reference.h | 5 +- thrust/detail/reference_forward_declaration.h | 5 +- thrust/detail/remove.inl | 5 +- thrust/detail/replace.inl | 5 +- thrust/detail/reverse.inl | 5 +- thrust/detail/scan.inl | 5 +- thrust/detail/scatter.inl | 6 +- thrust/detail/select_system.h | 5 +- thrust/detail/seq.h | 5 +- thrust/detail/sequence.inl | 5 +- thrust/detail/set_operations.inl | 5 +- thrust/detail/shuffle.inl | 4 +- thrust/detail/sort.inl | 5 +- thrust/detail/static_assert.h | 13 +- thrust/detail/static_map.h | 5 +- thrust/detail/swap.h | 5 +- thrust/detail/swap_ranges.inl | 5 +- thrust/detail/tabulate.inl | 5 +- thrust/detail/temporary_array.h | 10 +- thrust/detail/temporary_array.inl | 5 +- thrust/detail/temporary_buffer.h | 5 +- thrust/detail/transform.inl | 5 +- thrust/detail/transform_reduce.inl | 5 +- thrust/detail/transform_scan.inl | 5 +- thrust/detail/trivial_sequence.h | 5 +- thrust/detail/tuple.inl | 5 +- thrust/detail/tuple_algorithms.h | 5 +- thrust/detail/tuple_meta_transform.h | 5 +- thrust/detail/tuple_transform.h | 5 +- thrust/detail/type_traits.h | 5 +- thrust/detail/type_traits/function_traits.h | 5 +- .../detail/type_traits/has_member_function.h | 116 +++-------------- .../detail/type_traits/has_trivial_assign.h | 5 +- thrust/detail/type_traits/is_call_possible.h | 5 +- .../type_traits/is_metafunction_defined.h | 5 +- .../iterator/is_discard_iterator.h | 5 +- .../type_traits/iterator/is_output_iterator.h | 5 +- thrust/detail/type_traits/minimum_type.h | 9 +- thrust/detail/type_traits/pointer_traits.h | 5 +- .../result_of_adaptable_function.h | 5 +- thrust/detail/uninitialized_copy.inl | 5 +- thrust/detail/uninitialized_fill.inl | 5 +- thrust/detail/unique.inl | 5 +- thrust/detail/use_default.h | 5 +- thrust/detail/util/align.h | 5 +- thrust/detail/vector_base.h | 5 +- thrust/detail/vector_base.inl | 5 +- thrust/device_allocator.h | 6 +- thrust/device_delete.h | 5 +- thrust/device_free.h | 5 +- thrust/device_make_unique.h | 5 +- thrust/device_malloc.h | 5 +- thrust/device_malloc_allocator.h | 7 +- thrust/device_new.h | 6 +- thrust/device_new_allocator.h | 6 +- thrust/device_ptr.h | 6 +- thrust/device_reference.h | 6 +- thrust/device_vector.h | 7 +- thrust/distance.h | 7 +- thrust/equal.h | 7 +- thrust/execution_policy.h | 7 +- thrust/extrema.h | 7 +- thrust/fill.h | 7 +- thrust/find.h | 8 +- thrust/for_each.h | 6 +- thrust/functional.h | 6 +- thrust/future.h | 6 +- thrust/gather.h | 6 +- thrust/generate.h | 6 +- thrust/host_vector.h | 6 +- thrust/inner_product.h | 6 +- thrust/iterator/constant_iterator.h | 5 +- thrust/iterator/counting_iterator.h | 5 +- thrust/iterator/detail/any_assign.h | 5 +- thrust/iterator/detail/any_system_tag.h | 5 +- .../iterator/detail/constant_iterator_base.h | 5 +- thrust/iterator/detail/counting_iterator.inl | 5 +- thrust/iterator/detail/device_system_tag.h | 5 +- .../iterator/detail/discard_iterator_base.h | 5 +- thrust/iterator/detail/distance_from_result.h | 5 +- thrust/iterator/detail/host_system_tag.h | 5 +- thrust/iterator/detail/is_iterator_category.h | 5 +- .../iterator/detail/iterator_adaptor_base.h | 5 +- .../detail/iterator_category_to_system.h | 5 +- .../detail/iterator_category_to_traversal.h | 5 +- ...rator_category_with_system_and_traversal.h | 5 +- .../detail/iterator_facade_category.h | 5 +- thrust/iterator/detail/iterator_traits.inl | 5 +- .../iterator/detail/iterator_traversal_tags.h | 5 +- thrust/iterator/detail/join_iterator.h | 5 +- thrust/iterator/detail/minimum_category.h | 5 +- thrust/iterator/detail/minimum_system.h | 5 +- thrust/iterator/detail/normal_iterator.h | 5 +- .../detail/permutation_iterator_base.h | 5 +- thrust/iterator/detail/retag.h | 5 +- thrust/iterator/detail/reverse_iterator.inl | 5 +- .../iterator/detail/reverse_iterator_base.h | 5 +- thrust/iterator/detail/tagged_iterator.h | 5 +- .../transform_input_output_iterator.inl | 5 +- thrust/iterator/detail/transform_iterator.inl | 5 +- .../detail/transform_output_iterator.inl | 5 +- .../detail/tuple_of_iterator_references.h | 5 +- thrust/iterator/detail/universal_categories.h | 5 +- thrust/iterator/detail/zip_iterator.inl | 5 +- thrust/iterator/detail/zip_iterator_base.h | 5 +- thrust/iterator/discard_iterator.h | 5 +- thrust/iterator/iterator_adaptor.h | 5 +- thrust/iterator/iterator_categories.h | 5 +- thrust/iterator/iterator_facade.h | 5 +- thrust/iterator/iterator_traits.h | 5 +- thrust/iterator/permutation_iterator.h | 5 +- thrust/iterator/retag.h | 5 +- thrust/iterator/reverse_iterator.h | 5 +- .../transform_input_output_iterator.h | 5 +- thrust/iterator/transform_iterator.h | 5 +- thrust/iterator/transform_output_iterator.h | 5 +- thrust/iterator/zip_iterator.h | 5 +- thrust/limits.h | 6 +- thrust/logical.h | 8 +- thrust/memory.h | 6 +- thrust/merge.h | 7 +- thrust/mismatch.h | 7 +- thrust/mr/allocator.h | 5 +- thrust/mr/device_memory_resource.h | 5 +- thrust/mr/disjoint_pool.h | 5 +- thrust/mr/disjoint_sync_pool.h | 5 +- thrust/mr/disjoint_tls_pool.h | 5 +- thrust/mr/fancy_pointer_resource.h | 5 +- thrust/mr/host_memory_resource.h | 5 +- thrust/mr/memory_resource.h | 5 +- thrust/mr/new.h | 5 +- thrust/mr/polymorphic_adaptor.h | 5 +- thrust/mr/pool.h | 5 +- thrust/mr/pool_options.h | 5 +- thrust/mr/sync_pool.h | 5 +- thrust/mr/tls_pool.h | 5 +- thrust/mr/validator.h | 5 +- thrust/optional.h | 19 ++- thrust/pair.h | 6 +- thrust/partition.h | 7 +- thrust/per_device_resource.h | 6 +- thrust/random.h | 7 +- thrust/random/detail/discard_block_engine.inl | 5 +- .../detail/linear_congruential_engine.inl | 5 +- .../linear_congruential_engine_discard.h | 5 +- .../detail/linear_feedback_shift_engine.inl | 5 +- .../linear_feedback_shift_engine_wordmask.h | 5 +- thrust/random/detail/mod.h | 5 +- thrust/random/detail/normal_distribution.inl | 5 +- .../random/detail/normal_distribution_base.h | 5 +- thrust/random/detail/random_core_access.h | 5 +- .../detail/subtract_with_carry_engine.inl | 5 +- .../detail/uniform_int_distribution.inl | 5 +- .../detail/uniform_real_distribution.inl | 5 +- thrust/random/detail/xor_combine_engine.inl | 5 +- thrust/random/detail/xor_combine_engine_max.h | 5 +- thrust/random/discard_block_engine.h | 5 +- thrust/random/linear_congruential_engine.h | 5 +- thrust/random/linear_feedback_shift_engine.h | 5 +- thrust/random/normal_distribution.h | 5 +- thrust/random/subtract_with_carry_engine.h | 5 +- thrust/random/uniform_int_distribution.h | 8 +- thrust/random/uniform_real_distribution.h | 5 +- thrust/random/xor_combine_engine.h | 5 +- thrust/reduce.h | 8 +- thrust/remove.h | 8 +- thrust/replace.h | 8 +- thrust/reverse.h | 8 +- thrust/scan.h | 8 +- thrust/scatter.h | 8 +- thrust/sequence.h | 7 +- thrust/set_operations.h | 8 +- thrust/shuffle.h | 4 +- thrust/sort.h | 8 +- thrust/swap.h | 11 +- thrust/system/cpp/detail/execution_policy.h | 5 +- thrust/system/cpp/detail/memory.inl | 5 +- thrust/system/cpp/detail/par.h | 5 +- thrust/system/cpp/detail/vector.inl | 5 +- thrust/system/cpp/execution_policy.h | 5 +- thrust/system/cpp/memory.h | 5 +- thrust/system/cpp/memory_resource.h | 8 +- thrust/system/cpp/pointer.h | 5 +- thrust/system/cpp/vector.h | 5 +- thrust/system/cuda/config.h | 3 - .../system/cuda/detail/adjacent_difference.h | 41 +++--- thrust/system/cuda/detail/assign_value.h | 5 +- thrust/system/cuda/detail/async/copy.h | 5 +- .../system/cuda/detail/async/customization.h | 5 +- .../system/cuda/detail/async/exclusive_scan.h | 25 ++-- thrust/system/cuda/detail/async/for_each.h | 5 +- .../system/cuda/detail/async/inclusive_scan.h | 17 ++- thrust/system/cuda/detail/async/reduce.h | 13 +- thrust/system/cuda/detail/async/sort.h | 15 +-- thrust/system/cuda/detail/async/transform.h | 5 +- thrust/system/cuda/detail/binary_search.h | 29 ++--- thrust/system/cuda/detail/copy.h | 10 +- thrust/system/cuda/detail/copy_if.h | 49 ++++--- .../system/cuda/detail/core/agent_launcher.h | 7 +- thrust/system/cuda/detail/core/alignment.h | 5 +- .../cuda/detail/core/triple_chevron_launch.h | 5 +- thrust/system/cuda/detail/core/util.h | 68 +++++----- thrust/system/cuda/detail/count.h | 5 +- thrust/system/cuda/detail/cross_system.h | 5 +- thrust/system/cuda/detail/equal.h | 5 +- thrust/system/cuda/detail/error.inl | 5 +- thrust/system/cuda/detail/execution_policy.h | 5 +- thrust/system/cuda/detail/extrema.h | 29 ++--- thrust/system/cuda/detail/fill.h | 5 +- thrust/system/cuda/detail/find.h | 10 +- thrust/system/cuda/detail/for_each.h | 5 +- thrust/system/cuda/detail/future.inl | 5 +- thrust/system/cuda/detail/gather.h | 5 +- thrust/system/cuda/detail/generate.h | 5 +- thrust/system/cuda/detail/get_value.h | 5 +- thrust/system/cuda/detail/inner_product.h | 5 +- .../cuda/detail/internal/copy_cross_system.h | 5 +- .../detail/internal/copy_device_to_device.h | 5 +- thrust/system/cuda/detail/iter_swap.h | 5 +- .../cuda/detail/make_unsigned_special.h | 5 +- thrust/system/cuda/detail/malloc_and_free.h | 13 +- thrust/system/cuda/detail/memory.inl | 5 +- thrust/system/cuda/detail/merge.h | 41 +++--- thrust/system/cuda/detail/mismatch.h | 10 +- thrust/system/cuda/detail/par.h | 5 +- thrust/system/cuda/detail/par_to_seq.h | 5 +- thrust/system/cuda/detail/parallel_for.h | 5 +- thrust/system/cuda/detail/partition.h | 59 +++++---- .../system/cuda/detail/per_device_resource.h | 5 +- thrust/system/cuda/detail/reduce.h | 103 ++++++++------- thrust/system/cuda/detail/reduce_by_key.h | 55 ++++---- thrust/system/cuda/detail/remove.h | 5 +- thrust/system/cuda/detail/replace.h | 5 +- thrust/system/cuda/detail/reverse.h | 10 +- thrust/system/cuda/detail/scan.h | 49 ++++--- thrust/system/cuda/detail/scan_by_key.h | 65 +++++----- thrust/system/cuda/detail/scatter.h | 5 +- thrust/system/cuda/detail/set_operations.h | 45 ++++--- thrust/system/cuda/detail/sort.h | 69 +++++----- thrust/system/cuda/detail/swap_ranges.h | 5 +- thrust/system/cuda/detail/tabulate.h | 5 +- thrust/system/cuda/detail/terminate.h | 5 +- thrust/system/cuda/detail/transform.h | 5 +- thrust/system/cuda/detail/transform_reduce.h | 5 +- thrust/system/cuda/detail/transform_scan.h | 5 +- .../system/cuda/detail/uninitialized_copy.h | 5 +- .../system/cuda/detail/uninitialized_fill.h | 5 +- thrust/system/cuda/detail/unique.h | 53 ++++---- thrust/system/cuda/detail/unique_by_key.h | 53 ++++---- thrust/system/cuda/detail/util.h | 5 +- thrust/system/cuda/error.h | 5 +- .../cuda/experimental/pinned_allocator.h | 5 +- thrust/system/cuda/future.h | 5 +- thrust/system/cuda/memory.h | 5 +- thrust/system/cuda/memory_resource.h | 5 +- thrust/system/cuda/pointer.h | 5 +- thrust/system/cuda/vector.h | 5 +- thrust/system/detail/bad_alloc.h | 5 +- thrust/system/detail/errno.h | 5 +- thrust/system/detail/error_category.inl | 5 +- thrust/system/detail/error_code.inl | 5 +- thrust/system/detail/error_condition.inl | 5 +- .../detail/generic/adjacent_difference.h | 5 +- .../detail/generic/adjacent_difference.inl | 5 +- thrust/system/detail/generic/advance.h | 5 +- thrust/system/detail/generic/advance.inl | 5 +- thrust/system/detail/generic/binary_search.h | 5 +- .../system/detail/generic/binary_search.inl | 5 +- thrust/system/detail/generic/copy.h | 5 +- thrust/system/detail/generic/copy.inl | 5 +- thrust/system/detail/generic/copy_if.h | 5 +- thrust/system/detail/generic/copy_if.inl | 5 +- thrust/system/detail/generic/count.h | 5 +- thrust/system/detail/generic/count.inl | 5 +- thrust/system/detail/generic/distance.h | 5 +- thrust/system/detail/generic/distance.inl | 5 +- thrust/system/detail/generic/equal.h | 5 +- thrust/system/detail/generic/equal.inl | 5 +- thrust/system/detail/generic/extrema.h | 5 +- thrust/system/detail/generic/extrema.inl | 5 +- thrust/system/detail/generic/fill.h | 5 +- thrust/system/detail/generic/find.h | 5 +- thrust/system/detail/generic/find.inl | 5 +- thrust/system/detail/generic/for_each.h | 5 +- thrust/system/detail/generic/gather.h | 5 +- thrust/system/detail/generic/gather.inl | 5 +- thrust/system/detail/generic/generate.h | 5 +- thrust/system/detail/generic/generate.inl | 5 +- thrust/system/detail/generic/inner_product.h | 5 +- .../system/detail/generic/inner_product.inl | 5 +- thrust/system/detail/generic/logical.h | 5 +- thrust/system/detail/generic/memory.h | 5 +- thrust/system/detail/generic/memory.inl | 5 +- thrust/system/detail/generic/merge.h | 5 +- thrust/system/detail/generic/merge.inl | 5 +- thrust/system/detail/generic/mismatch.h | 5 +- thrust/system/detail/generic/mismatch.inl | 5 +- thrust/system/detail/generic/partition.h | 5 +- thrust/system/detail/generic/partition.inl | 5 +- .../detail/generic/per_device_resource.h | 5 +- thrust/system/detail/generic/reduce.h | 5 +- thrust/system/detail/generic/reduce.inl | 5 +- thrust/system/detail/generic/reduce_by_key.h | 5 +- .../system/detail/generic/reduce_by_key.inl | 5 +- thrust/system/detail/generic/remove.h | 5 +- thrust/system/detail/generic/remove.inl | 5 +- thrust/system/detail/generic/replace.h | 5 +- thrust/system/detail/generic/replace.inl | 5 +- thrust/system/detail/generic/reverse.h | 5 +- thrust/system/detail/generic/reverse.inl | 5 +- .../detail/generic/scalar/binary_search.h | 5 +- .../detail/generic/scalar/binary_search.inl | 5 +- thrust/system/detail/generic/scan.h | 5 +- thrust/system/detail/generic/scan.inl | 5 +- thrust/system/detail/generic/scan_by_key.h | 5 +- thrust/system/detail/generic/scan_by_key.inl | 5 +- thrust/system/detail/generic/scatter.h | 5 +- thrust/system/detail/generic/scatter.inl | 5 +- thrust/system/detail/generic/select_system.h | 5 +- .../system/detail/generic/select_system.inl | 5 +- .../detail/generic/select_system_exists.h | 5 +- thrust/system/detail/generic/sequence.h | 5 +- thrust/system/detail/generic/sequence.inl | 5 +- thrust/system/detail/generic/set_operations.h | 5 +- .../system/detail/generic/set_operations.inl | 5 +- thrust/system/detail/generic/shuffle.h | 4 +- thrust/system/detail/generic/shuffle.inl | 4 +- thrust/system/detail/generic/sort.h | 5 +- thrust/system/detail/generic/sort.inl | 5 +- thrust/system/detail/generic/swap_ranges.h | 5 +- thrust/system/detail/generic/swap_ranges.inl | 5 +- thrust/system/detail/generic/tabulate.h | 5 +- thrust/system/detail/generic/tabulate.inl | 5 +- thrust/system/detail/generic/tag.h | 5 +- .../system/detail/generic/temporary_buffer.h | 5 +- .../detail/generic/temporary_buffer.inl | 5 +- thrust/system/detail/generic/transform.h | 5 +- thrust/system/detail/generic/transform.inl | 5 +- .../system/detail/generic/transform_reduce.h | 5 +- .../detail/generic/transform_reduce.inl | 5 +- thrust/system/detail/generic/transform_scan.h | 5 +- .../system/detail/generic/transform_scan.inl | 5 +- .../detail/generic/uninitialized_copy.h | 5 +- .../detail/generic/uninitialized_copy.inl | 5 +- .../detail/generic/uninitialized_fill.h | 5 +- .../detail/generic/uninitialized_fill.inl | 5 +- thrust/system/detail/generic/unique.h | 5 +- thrust/system/detail/generic/unique.inl | 5 +- thrust/system/detail/generic/unique_by_key.h | 5 +- .../system/detail/generic/unique_by_key.inl | 5 +- thrust/system/detail/internal/decompose.h | 5 +- .../detail/sequential/adjacent_difference.h | 5 +- .../system/detail/sequential/assign_value.h | 5 +- .../system/detail/sequential/binary_search.h | 5 +- thrust/system/detail/sequential/copy.h | 5 +- thrust/system/detail/sequential/copy.inl | 5 +- .../system/detail/sequential/copy_backward.h | 5 +- thrust/system/detail/sequential/copy_if.h | 5 +- .../detail/sequential/execution_policy.h | 5 +- thrust/system/detail/sequential/extrema.h | 5 +- thrust/system/detail/sequential/find.h | 5 +- thrust/system/detail/sequential/for_each.h | 5 +- .../system/detail/sequential/general_copy.h | 5 +- thrust/system/detail/sequential/get_value.h | 5 +- .../system/detail/sequential/insertion_sort.h | 5 +- thrust/system/detail/sequential/iter_swap.h | 5 +- .../detail/sequential/malloc_and_free.h | 5 +- thrust/system/detail/sequential/merge.h | 5 +- thrust/system/detail/sequential/merge.inl | 5 +- thrust/system/detail/sequential/partition.h | 9 +- thrust/system/detail/sequential/reduce.h | 5 +- .../system/detail/sequential/reduce_by_key.h | 5 +- thrust/system/detail/sequential/remove.h | 5 +- thrust/system/detail/sequential/scan.h | 5 +- thrust/system/detail/sequential/scan_by_key.h | 5 +- .../system/detail/sequential/set_operations.h | 5 +- thrust/system/detail/sequential/sort.h | 5 +- thrust/system/detail/sequential/sort.inl | 5 +- .../detail/sequential/stable_merge_sort.h | 5 +- .../detail/sequential/stable_merge_sort.inl | 5 +- .../detail/sequential/stable_primitive_sort.h | 5 +- .../sequential/stable_primitive_sort.inl | 5 +- .../detail/sequential/stable_radix_sort.h | 5 +- .../detail/sequential/stable_radix_sort.inl | 5 +- .../system/detail/sequential/trivial_copy.h | 5 +- thrust/system/detail/sequential/unique.h | 5 +- .../system/detail/sequential/unique_by_key.h | 5 +- thrust/system/detail/system_error.inl | 5 +- thrust/system/error_code.h | 5 +- .../system/omp/detail/adjacent_difference.h | 5 +- thrust/system/omp/detail/binary_search.h | 5 +- thrust/system/omp/detail/copy.h | 5 +- thrust/system/omp/detail/copy.inl | 5 +- thrust/system/omp/detail/copy_if.h | 5 +- thrust/system/omp/detail/copy_if.inl | 5 +- .../system/omp/detail/default_decomposition.h | 5 +- .../omp/detail/default_decomposition.inl | 5 +- thrust/system/omp/detail/execution_policy.h | 5 +- thrust/system/omp/detail/extrema.h | 5 +- thrust/system/omp/detail/find.h | 5 +- thrust/system/omp/detail/for_each.h | 5 +- thrust/system/omp/detail/for_each.inl | 5 +- thrust/system/omp/detail/memory.inl | 5 +- thrust/system/omp/detail/par.h | 5 +- thrust/system/omp/detail/partition.h | 5 +- thrust/system/omp/detail/partition.inl | 5 +- thrust/system/omp/detail/reduce.h | 5 +- thrust/system/omp/detail/reduce.inl | 5 +- thrust/system/omp/detail/reduce_by_key.h | 5 +- thrust/system/omp/detail/reduce_by_key.inl | 5 +- thrust/system/omp/detail/reduce_intervals.h | 5 +- thrust/system/omp/detail/reduce_intervals.inl | 5 +- thrust/system/omp/detail/remove.h | 5 +- thrust/system/omp/detail/remove.inl | 5 +- thrust/system/omp/detail/sort.h | 5 +- thrust/system/omp/detail/sort.inl | 5 +- thrust/system/omp/detail/unique.h | 5 +- thrust/system/omp/detail/unique.inl | 5 +- thrust/system/omp/detail/unique_by_key.h | 5 +- thrust/system/omp/detail/unique_by_key.inl | 5 +- thrust/system/omp/execution_policy.h | 5 +- thrust/system/omp/memory.h | 5 +- thrust/system/omp/memory_resource.h | 6 +- thrust/system/omp/pointer.h | 5 +- thrust/system/omp/vector.h | 5 +- thrust/system/system_error.h | 5 +- .../system/tbb/detail/adjacent_difference.h | 5 +- thrust/system/tbb/detail/copy.h | 5 +- thrust/system/tbb/detail/copy.inl | 5 +- thrust/system/tbb/detail/copy_if.h | 5 +- thrust/system/tbb/detail/copy_if.inl | 5 +- thrust/system/tbb/detail/execution_policy.h | 5 +- thrust/system/tbb/detail/extrema.h | 5 +- thrust/system/tbb/detail/find.h | 5 +- thrust/system/tbb/detail/for_each.h | 5 +- thrust/system/tbb/detail/for_each.inl | 5 +- thrust/system/tbb/detail/memory.inl | 5 +- thrust/system/tbb/detail/merge.h | 5 +- thrust/system/tbb/detail/merge.inl | 5 +- thrust/system/tbb/detail/par.h | 5 +- thrust/system/tbb/detail/partition.h | 5 +- thrust/system/tbb/detail/partition.inl | 5 +- thrust/system/tbb/detail/reduce.h | 5 +- thrust/system/tbb/detail/reduce.inl | 5 +- thrust/system/tbb/detail/reduce_by_key.h | 5 +- thrust/system/tbb/detail/reduce_by_key.inl | 5 +- thrust/system/tbb/detail/reduce_intervals.h | 5 +- thrust/system/tbb/detail/remove.h | 5 +- thrust/system/tbb/detail/remove.inl | 5 +- thrust/system/tbb/detail/scan.h | 5 +- thrust/system/tbb/detail/scan.inl | 5 +- thrust/system/tbb/detail/sort.h | 5 +- thrust/system/tbb/detail/sort.inl | 5 +- thrust/system/tbb/detail/unique.h | 5 +- thrust/system/tbb/detail/unique.inl | 5 +- thrust/system/tbb/detail/unique_by_key.h | 5 +- thrust/system/tbb/detail/unique_by_key.inl | 5 +- thrust/system/tbb/execution_policy.h | 5 +- thrust/system/tbb/memory.h | 5 +- thrust/system/tbb/memory_resource.h | 6 +- thrust/system/tbb/pointer.h | 5 +- thrust/system/tbb/vector.h | 5 +- thrust/system_error.h | 6 +- thrust/tabulate.h | 8 +- thrust/transform.h | 8 +- thrust/transform_reduce.h | 8 +- thrust/transform_scan.h | 8 +- thrust/tuple.h | 6 +- thrust/type_traits/integer_sequence.h | 5 +- thrust/type_traits/is_contiguous_iterator.h | 12 +- thrust/type_traits/is_execution_policy.h | 5 +- ...operator_less_or_greater_function_object.h | 5 +- .../is_operator_plus_function_object.h | 5 +- thrust/type_traits/is_trivially_relocatable.h | 12 +- thrust/type_traits/logical_metafunctions.h | 5 +- thrust/type_traits/remove_cvref.h | 5 +- thrust/type_traits/void_t.h | 5 +- thrust/uninitialized_copy.h | 8 +- thrust/uninitialized_fill.h | 7 +- thrust/unique.h | 7 +- thrust/universal_allocator.h | 6 +- thrust/universal_vector.h | 6 +- thrust/version.h | 9 -- thrust/zip_function.h | 5 +- 623 files changed, 2118 insertions(+), 2634 deletions(-) create mode 100644 testing/cmake/check_namespace.cmake create mode 100644 testing/namespace_wrapped.cu create mode 100644 thrust/detail/config/namespace.h diff --git a/cmake/ThrustHeaderTesting.cmake b/cmake/ThrustHeaderTesting.cmake index 560c0a95a5..1c4ee003df 100644 --- a/cmake/ThrustHeaderTesting.cmake +++ b/cmake/ThrustHeaderTesting.cmake @@ -118,6 +118,11 @@ foreach(thrust_target IN LISTS THRUST_TARGETS) set(headertest_target ${config_prefix}.headers) add_library(${headertest_target} OBJECT ${headertest_srcs}) target_link_libraries(${headertest_target} PUBLIC ${thrust_target}) + # Wrap Thrust/CUB in a custom namespace to check proper use of ns macros: + target_compile_definitions(${headertest_target} PRIVATE + "THRUST_WRAPPED_NAMESPACE=wrapped_thrust" + "CUB_WRAPPED_NAMESPACE=wrapped_cub" + ) thrust_clone_target_properties(${headertest_target} ${thrust_target}) # Disable macro checks on TBB; the TBB atomic implementation uses `I` and diff --git a/dependencies/cub b/dependencies/cub index 1205f88467..bc87fbf5d4 160000 --- a/dependencies/cub +++ b/dependencies/cub @@ -1 +1 @@ -Subproject commit 1205f88467a2b376a8f684e777a76085f9dba458 +Subproject commit bc87fbf5d41f58a288d13741dec081197b9bb9dc diff --git a/testing/cmake/CMakeLists.txt b/testing/cmake/CMakeLists.txt index 007c0cbaea..ea02381720 100644 --- a/testing/cmake/CMakeLists.txt +++ b/testing/cmake/CMakeLists.txt @@ -26,3 +26,12 @@ if (THRUST_CPP_FOUND AND THRUST_CUDA_FOUND) ${extra_cmake_flags} ) endif() + +# Check that namespace macros are used correctly: +add_test( + NAME thrust.test.cmake.check_namespace + COMMAND + "${CMAKE_COMMAND}" + -D "Thrust_SOURCE_DIR=${Thrust_SOURCE_DIR}" + -P "${CMAKE_CURRENT_LIST_DIR}/check_namespace.cmake" +) diff --git a/testing/cmake/check_namespace.cmake b/testing/cmake/check_namespace.cmake new file mode 100644 index 0000000000..c884805c21 --- /dev/null +++ b/testing/cmake/check_namespace.cmake @@ -0,0 +1,88 @@ +# Check all files in thrust to make sure that they use +# THRUST_NAMESPACE_BEGIN/END instead of bare `namespace thrust {}` declarations. +# +# This is run as a ctest test named `thrust.test.cmake.check_namespace`, or +# manually with: +# cmake -D "Thrust_SOURCE_DIR=" -P check_namespace.cmake + +cmake_minimum_required(VERSION 3.15) + +set(exclusions + # This defines the macros and must have bare namespace declarations: + thrust/detail/config/namespace.h +) + +function(count_substrings input search_regex output_var) + string(REGEX MATCHALL "${search_regex}" matches "${input}") + list(LENGTH matches num_matches) + set(${output_var} ${num_matches} PARENT_SCOPE) +endfunction() + +set(bare_ns_regex "namespace[ \n\r\t]+thrust[ \n\r\t]*\\{") + +# Validation check for the above regex: +count_substrings([=[ +namespace thrust{ +namespace thrust { +namespace thrust { + namespace thrust { +namespace thrust +{ +namespace +thrust +{ +]=] + ${bare_ns_regex} valid_count) +if (NOT valid_count EQUAL 6) + message(FATAL_ERROR "Validation of bare namespace regex failed: " + "Matched ${valid_count} times, expected 6.") +endif() + +set(exit_code 0) +file(GLOB_RECURSE thrust_srcs + RELATIVE "${Thrust_SOURCE_DIR}" + "${Thrust_SOURCE_DIR}/thrust/*.h" + "${Thrust_SOURCE_DIR}/thrust/*.inl" + "${Thrust_SOURCE_DIR}/testing/*.cu" + "${Thrust_SOURCE_DIR}/examples/*.cu" +) + +foreach(src ${thrust_srcs}) + if (${src} IN_LIST exclusions) + continue() + endif() + + file(READ "${Thrust_SOURCE_DIR}/${src}" src_contents) + + count_substrings("${src_contents}" "${bare_ns_regex}" bare_ns_count) + count_substrings("${src_contents}" THRUST_NS_PREFIX prefix_count) + count_substrings("${src_contents}" THRUST_NS_POSTFIX postfix_count) + count_substrings("${src_contents}" THRUST_NAMESPACE_BEGIN begin_count) + count_substrings("${src_contents}" THRUST_NAMESPACE_END end_count) + + if (NOT bare_ns_count EQUAL 0) + message("'${src}' contains 'namespace thrust {...}'. Replace with THRUST_NAMESPACE macros.") + set(exit_code 1) + endif() + + if (NOT prefix_count EQUAL 0) + message("'${src}' contains 'THRUST_NS_PREFIX'. Replace with THRUST_NAMESPACE macros.") + set(exit_code 1) + endif() + + if (NOT postfix_count EQUAL 0) + message("'${src}' contains 'THRUST_NS_POSTFIX'. Replace with THRUST_NAMESPACE macros.") + set(exit_code 1) + endif() + + if (NOT begin_count EQUAL end_count) + message("'${src}' namespace macros are unbalanced:") + message(" - THRUST_NAMESPACE_BEGIN occurs ${begin_count} times.") + message(" - THRUST_NAMESPACE_END occurs ${end_count} times.") + set(exit_code 1) + endif() +endforeach() + +if (NOT exit_code EQUAL 0) + message(FATAL_ERROR "Errors detected.") +endif() diff --git a/testing/copy.cu b/testing/copy.cu index a93bf1c093..059ae70b17 100644 --- a/testing/copy.cu +++ b/testing/copy.cu @@ -733,15 +733,14 @@ struct only_set_when_expected_it } }; -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { // We need this type to pass as a non-const ref for unary_transform_functor // to compile: template <> struct is_non_const_reference : thrust::true_type {}; -} +} // end namespace detail template<> struct iterator_traits @@ -750,7 +749,7 @@ struct iterator_traits typedef only_set_when_expected_it reference; typedef thrust::random_access_device_iterator_tag iterator_category; }; -} +THRUST_NAMESPACE_END void TestCopyWithBigIndexesHelper(int magnitude) { diff --git a/testing/mr_disjoint_pool.cu b/testing/mr_disjoint_pool.cu index b9a35e8cb0..69a6005ece 100644 --- a/testing/mr_disjoint_pool.cu +++ b/testing/mr_disjoint_pool.cu @@ -32,7 +32,8 @@ struct alloc_id } }; -namespace thrust { namespace detail { +THRUST_NAMESPACE_BEGIN +namespace detail { template<> struct pointer_traits { @@ -48,7 +49,10 @@ struct pointer_traits return reinterpret_cast(id.alignment); } }; -}} + +} // end namespace detail + +THRUST_NAMESPACE_END class dummy_resource final : public thrust::mr::memory_resource { diff --git a/testing/namespace_wrapped.cu b/testing/namespace_wrapped.cu new file mode 100644 index 0000000000..b6bcb3dbb5 --- /dev/null +++ b/testing/namespace_wrapped.cu @@ -0,0 +1,43 @@ +// Wrap thrust and cub in different enclosing namespaces +// (In practice, you probably want these to be the same, in which case just +// set THRUST_CUB_WRAPPED_NAMESPACE to set both). +#define THRUST_WRAPPED_NAMESPACE wrap_thrust +#define CUB_WRAPPED_NAMESPACE wrap_cub + +#include +#include +#include +#include +#include + +#include + +// Test that we can use a few common utilities and algorithms from a wrapped +// namespace at runtime. More extensive testing is performed by the header +// tests and the check_namespace.cmake test. +void TestWrappedNamespace() +{ + const std::size_t n = 2048; + + const auto in_1_begin = + ::wrap_thrust::thrust::make_constant_iterator(12); + const auto in_2_begin = + ::wrap_thrust::thrust::make_counting_iterator(1024); + + // Check that the qualifier resolves properly: + THRUST_NS_QUALIFIER::device_vector d_out(n); + + ::wrap_thrust::thrust::transform(in_1_begin, + in_1_begin + n, + in_2_begin, + d_out.begin(), + ::wrap_thrust::thrust::plus<>{}); + + ::wrap_thrust::thrust::host_vector h_out(d_out); + + for (std::size_t i = 0; i < n; ++i) + { + ASSERT_EQUAL(h_out[i], static_cast(i) + 1024 + 12); + } +} +DECLARE_UNITTEST(TestWrappedNamespace); diff --git a/testing/scan.cu b/testing/scan.cu index 0cf38d3088..4d5c672a71 100644 --- a/testing/scan.cu +++ b/testing/scan.cu @@ -583,15 +583,14 @@ struct only_set_when_expected_it } }; -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template<> struct iterator_traits { typedef long long value_type; typedef only_set_when_expected_it reference; }; -} +THRUST_NAMESPACE_END void TestInclusiveScanWithBigIndexesHelper(int magnitude) { diff --git a/testing/unittest/assertions.h b/testing/unittest/assertions.h index ad72b5d6a0..855d705a4c 100644 --- a/testing/unittest/assertions.h +++ b/testing/unittest/assertions.h @@ -99,15 +99,15 @@ double const DEFAULT_ABSOLUTE_TOL = 1e-4; template struct value_type { - typedef typename thrust::detail::remove_const< - typename thrust::detail::remove_reference< + typedef typename THRUST_NS_QUALIFIER::detail::remove_const< + typename THRUST_NS_QUALIFIER::detail::remove_reference< T >::type >::type type; }; template - struct value_type< thrust::device_reference > + struct value_type< THRUST_NS_QUALIFIER::device_reference > { typedef typename value_type::type type; }; @@ -328,7 +328,7 @@ void assert_almost_equal(T1 a, T2 b, template -void assert_almost_equal(thrust::complex a, thrust::complex b, +void assert_almost_equal(THRUST_NS_QUALIFIER::complex a, THRUST_NS_QUALIFIER::complex b, const std::string& filename = "unknown", int lineno = -1, double a_tol = DEFAULT_ABSOLUTE_TOL, double r_tol = DEFAULT_RELATIVE_TOL) @@ -344,7 +344,7 @@ void assert_almost_equal(thrust::complex a, thrust::complex b, template - void assert_almost_equal(const thrust::complex& a, const std::complex& b, + void assert_almost_equal(const THRUST_NS_QUALIFIER::complex& a, const std::complex& b, const std::string& filename = "unknown", int lineno = -1, double a_tol = DEFAULT_ABSOLUTE_TOL, double r_tol = DEFAULT_RELATIVE_TOL) @@ -371,12 +371,12 @@ class almost_equal_to template -class almost_equal_to > +class almost_equal_to > { public: double a_tol, r_tol; almost_equal_to(double _a_tol = DEFAULT_ABSOLUTE_TOL, double _r_tol = DEFAULT_RELATIVE_TOL) : a_tol(_a_tol), r_tol(_r_tol) {} - bool operator()(const thrust::complex& a, const thrust::complex& b) const { + bool operator()(const THRUST_NS_QUALIFIER::complex& a, const THRUST_NS_QUALIFIER::complex& b) const { return almost_equal((double) a.real(), (double) b.real(), a_tol, r_tol) && almost_equal((double) a.imag(), (double) b.imag(), a_tol, r_tol); } @@ -389,15 +389,15 @@ template ::type difference_type; - typedef typename thrust::iterator_value::type InputType; + typedef typename THRUST_NS_QUALIFIER::iterator_difference::type difference_type; + typedef typename THRUST_NS_QUALIFIER::iterator_value::type InputType; bool failure = false; - difference_type length1 = thrust::distance(first1, last1); - difference_type length2 = thrust::distance(first2, last2); + difference_type length1 = THRUST_NS_QUALIFIER::distance(first1, last1); + difference_type length2 = THRUST_NS_QUALIFIER::distance(first2, last2); - difference_type min_length = thrust::min(length1, length2); + difference_type min_length = THRUST_NS_QUALIFIER::min(length1, length2); unittest::UnitTestFailure f; f << "[" << filename << ":" << lineno << "] "; @@ -463,8 +463,8 @@ template void assert_equal(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, const std::string& filename = "unknown", int lineno = -1) { - typedef typename thrust::iterator_traits::value_type InputType; - assert_equal(first1, last1, first2, last2, thrust::equal_to(), filename, lineno); + typedef typename THRUST_NS_QUALIFIER::iterator_traits::value_type InputType; + assert_equal(first1, last1, first2, last2, THRUST_NS_QUALIFIER::equal_to(), filename, lineno); } @@ -473,76 +473,85 @@ void assert_almost_equal(ForwardIterator1 first1, ForwardIterator1 last1, Forwar const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { - typedef typename thrust::iterator_traits::value_type InputType; + typedef typename THRUST_NS_QUALIFIER::iterator_traits::value_type InputType; assert_equal(first1, last1, first2, last2, almost_equal_to(a_tol, r_tol), filename, lineno); } template -void assert_equal(const thrust::host_vector& A, const thrust::host_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::host_vector& A, + const THRUST_NS_QUALIFIER::host_vector& B, const std::string& filename = "unknown", int lineno = -1) { assert_equal(A.begin(), A.end(), B.begin(), B.end(), filename, lineno); } template -void assert_equal(const thrust::host_vector& A, const thrust::device_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::host_vector& A, + const THRUST_NS_QUALIFIER::device_vector& B, const std::string& filename = "unknown", int lineno = -1) { - thrust::host_vector B_host = B; + THRUST_NS_QUALIFIER::host_vector B_host = B; assert_equal(A, B_host, filename, lineno); } template -void assert_equal(const thrust::device_vector& A, const thrust::host_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::device_vector& A, + const THRUST_NS_QUALIFIER::host_vector& B, const std::string& filename = "unknown", int lineno = -1) { - thrust::host_vector A_host = A; + THRUST_NS_QUALIFIER::host_vector A_host = A; assert_equal(A_host, B, filename, lineno); } template -void assert_equal(const thrust::device_vector& A, const thrust::device_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::device_vector& A, + const THRUST_NS_QUALIFIER::device_vector& B, const std::string& filename = "unknown", int lineno = -1) { - thrust::host_vector A_host = A; - thrust::host_vector B_host = B; + THRUST_NS_QUALIFIER::host_vector A_host = A; + THRUST_NS_QUALIFIER::host_vector B_host = B; assert_equal(A_host, B_host, filename, lineno); } template -void assert_equal(const thrust::universal_vector& A, const thrust::universal_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::universal_vector& A, + const THRUST_NS_QUALIFIER::universal_vector& B, const std::string& filename = "unknown", int lineno = -1) { assert_equal(A.begin(), A.end(), B.begin(), B.end(), filename, lineno); } template -void assert_equal(const thrust::host_vector& A, const thrust::universal_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::host_vector& A, + const THRUST_NS_QUALIFIER::universal_vector& B, const std::string& filename = "unknown", int lineno = -1) { assert_equal(A.begin(), A.end(), B.begin(), B.end(), filename, lineno); } template -void assert_equal(const thrust::universal_vector& A, const thrust::host_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::universal_vector& A, + const THRUST_NS_QUALIFIER::host_vector& B, const std::string& filename = "unknown", int lineno = -1) { assert_equal(A.begin(), A.end(), B.begin(), B.end(), filename, lineno); } template -void assert_equal(const thrust::device_vector& A, const thrust::universal_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::device_vector& A, + const THRUST_NS_QUALIFIER::universal_vector& B, const std::string& filename = "unknown", int lineno = -1) { - thrust::host_vector A_host = A; + THRUST_NS_QUALIFIER::host_vector A_host = A; assert_equal(A_host, B, filename, lineno); } template -void assert_equal(const thrust::universal_vector& A, const thrust::device_vector& B, +void assert_equal(const THRUST_NS_QUALIFIER::universal_vector& A, + const THRUST_NS_QUALIFIER::device_vector& B, const std::string& filename = "unknown", int lineno = -1) { - thrust::host_vector B_host = B; + THRUST_NS_QUALIFIER::host_vector B_host = B; assert_equal(A, B_host, filename, lineno); } @@ -554,7 +563,8 @@ void assert_equal(const std::vector& A, const std::vector& B } template -void assert_almost_equal(const thrust::host_vector& A, const thrust::host_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::host_vector& A, + const THRUST_NS_QUALIFIER::host_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { @@ -562,35 +572,39 @@ void assert_almost_equal(const thrust::host_vector& A, const thrust::h } template -void assert_almost_equal(const thrust::host_vector& A, const thrust::device_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::host_vector& A, + const THRUST_NS_QUALIFIER::device_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { - thrust::host_vector B_host = B; + THRUST_NS_QUALIFIER::host_vector B_host = B; assert_almost_equal(A, B_host, filename, lineno, a_tol, r_tol); } template -void assert_almost_equal(const thrust::device_vector& A, const thrust::host_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::device_vector& A, + const THRUST_NS_QUALIFIER::host_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { - thrust::host_vector A_host = A; + THRUST_NS_QUALIFIER::host_vector A_host = A; assert_almost_equal(A_host, B, filename, lineno, a_tol, r_tol); } template -void assert_almost_equal(const thrust::device_vector& A, const thrust::device_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::device_vector& A, + const THRUST_NS_QUALIFIER::device_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { - thrust::host_vector A_host = A; - thrust::host_vector B_host = B; + THRUST_NS_QUALIFIER::host_vector A_host = A; + THRUST_NS_QUALIFIER::host_vector B_host = B; assert_almost_equal(A_host, B_host, filename, lineno, a_tol, r_tol); } template -void assert_almost_equal(const thrust::universal_vector& A, const thrust::universal_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::universal_vector& A, + const THRUST_NS_QUALIFIER::universal_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { @@ -598,7 +612,8 @@ void assert_almost_equal(const thrust::universal_vector& A, const thru } template -void assert_almost_equal(const thrust::host_vector& A, const thrust::universal_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::host_vector& A, + const THRUST_NS_QUALIFIER::universal_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { @@ -606,7 +621,8 @@ void assert_almost_equal(const thrust::host_vector& A, const thrust::u } template -void assert_almost_equal(const thrust::universal_vector& A, const thrust::host_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::universal_vector& A, + const THRUST_NS_QUALIFIER::host_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { @@ -614,20 +630,22 @@ void assert_almost_equal(const thrust::universal_vector& A, const thru } template -void assert_almost_equal(const thrust::device_vector& A, const thrust::universal_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::device_vector& A, + const THRUST_NS_QUALIFIER::universal_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { - thrust::host_vector A_host = A; + THRUST_NS_QUALIFIER::host_vector A_host = A; assert_almost_equal(A_host, B, filename, lineno, a_tol, r_tol); } template -void assert_almost_equal(const thrust::universal_vector& A, const thrust::device_vector& B, +void assert_almost_equal(const THRUST_NS_QUALIFIER::universal_vector& A, + const THRUST_NS_QUALIFIER::device_vector& B, const std::string& filename = "unknown", int lineno = -1, const double a_tol = DEFAULT_ABSOLUTE_TOL, const double r_tol = DEFAULT_RELATIVE_TOL) { - thrust::host_vector B_host = B; + THRUST_NS_QUALIFIER::host_vector B_host = B; assert_almost_equal(A, B_host, filename, lineno, a_tol, r_tol); } diff --git a/testing/unittest/random.h b/testing/unittest/random.h index 924c0f0e16..c94c3fecb0 100644 --- a/testing/unittest/random.h +++ b/testing/unittest/random.h @@ -25,14 +25,14 @@ template template struct generate_random_integer::value + typename THRUST_NS_QUALIFIER::detail::disable_if< + THRUST_NS_QUALIFIER::detail::is_non_bool_arithmetic::value >::type > { T operator()(unsigned int i) const { - thrust::default_random_engine rng(hash(i)); + THRUST_NS_QUALIFIER::default_random_engine rng(hash(i)); return static_cast(rng()); } @@ -40,15 +40,15 @@ template template struct generate_random_integer::value + typename THRUST_NS_QUALIFIER::detail::enable_if< + THRUST_NS_QUALIFIER::detail::is_non_bool_integral::value >::type > { T operator()(unsigned int i) const { - thrust::default_random_engine rng(hash(i)); - thrust::uniform_int_distribution dist; + THRUST_NS_QUALIFIER::default_random_engine rng(hash(i)); + THRUST_NS_QUALIFIER::uniform_int_distribution dist; return static_cast(dist(rng)); } @@ -56,8 +56,8 @@ template template struct generate_random_integer::value + typename THRUST_NS_QUALIFIER::detail::enable_if< + THRUST_NS_QUALIFIER::detail::is_floating_point::value >::type > { @@ -66,8 +66,8 @@ template T const min = std::numeric_limits::min(); T const max = std::numeric_limits::max(); - thrust::default_random_engine rng(hash(i)); - thrust::uniform_real_distribution dist(min, max); + THRUST_NS_QUALIFIER::default_random_engine rng(hash(i)); + THRUST_NS_QUALIFIER::uniform_real_distribution dist(min, max); return static_cast(dist(rng)); } @@ -78,8 +78,8 @@ template<> { bool operator()(unsigned int i) const { - thrust::default_random_engine rng(hash(i)); - thrust::uniform_int_distribution dist(0,1); + THRUST_NS_QUALIFIER::default_random_engine rng(hash(i)); + THRUST_NS_QUALIFIER::uniform_int_distribution dist(0,1); return dist(rng) == 1; } @@ -91,8 +91,8 @@ template { T operator()(unsigned int i) const { - thrust::default_random_engine rng(hash(i)); - thrust::uniform_int_distribution dist(0,20); + THRUST_NS_QUALIFIER::default_random_engine rng(hash(i)); + THRUST_NS_QUALIFIER::uniform_int_distribution dist(0,20); return static_cast(dist(rng)); } @@ -101,13 +101,13 @@ template template -thrust::host_vector random_integers(const size_t N) +THRUST_NS_QUALIFIER::host_vector random_integers(const size_t N) { - thrust::host_vector vec(N); - thrust::transform(thrust::counting_iterator(static_cast(0)), - thrust::counting_iterator(static_cast(N)), - vec.begin(), - generate_random_integer()); + THRUST_NS_QUALIFIER::host_vector vec(N); + THRUST_NS_QUALIFIER::transform(THRUST_NS_QUALIFIER::counting_iterator(static_cast(0)), + THRUST_NS_QUALIFIER::counting_iterator(static_cast(N)), + vec.begin(), + generate_random_integer()); return vec; } @@ -119,13 +119,13 @@ T random_integer() } template -thrust::host_vector random_samples(const size_t N) +THRUST_NS_QUALIFIER::host_vector random_samples(const size_t N) { - thrust::host_vector vec(N); - thrust::transform(thrust::counting_iterator(static_cast(0)), - thrust::counting_iterator(static_cast(N)), - vec.begin(), - generate_random_sample()); + THRUST_NS_QUALIFIER::host_vector vec(N); + THRUST_NS_QUALIFIER::transform(THRUST_NS_QUALIFIER::counting_iterator(static_cast(0)), + THRUST_NS_QUALIFIER::counting_iterator(static_cast(N)), + vec.begin(), + generate_random_sample()); return vec; } diff --git a/testing/unittest/special_types.h b/testing/unittest/special_types.h index b046a96eec..9e4b0b7432 100644 --- a/testing/unittest/special_types.h +++ b/testing/unittest/special_types.h @@ -128,7 +128,11 @@ void swap(user_swappable &x, user_swappable &y) y.was_swapped = false; } -class my_system : public thrust::device_execution_policy +// Inheriting from classes in anonymous namespaces is not allowed. +// The anonymous namespace tests don't use these, so just disable them: +#ifndef THRUST_USE_ANON_NAMESPACE + +class my_system : public THRUST_NS_QUALIFIER::device_execution_policy { public: my_system(int) @@ -163,21 +167,23 @@ class my_system : public thrust::device_execution_policy my_system(); }; -struct my_tag : thrust::device_execution_policy {}; +struct my_tag : THRUST_NS_QUALIFIER::device_execution_policy {}; + +#endif // THRUST_USE_ANON_NAMESPACE namespace unittest { -using thrust::detail::int8_t; -using thrust::detail::int16_t; -using thrust::detail::int32_t; -using thrust::detail::int64_t; +using THRUST_NS_QUALIFIER::detail::int8_t; +using THRUST_NS_QUALIFIER::detail::int16_t; +using THRUST_NS_QUALIFIER::detail::int32_t; +using THRUST_NS_QUALIFIER::detail::int64_t; -using thrust::detail::uint8_t; -using thrust::detail::uint16_t; -using thrust::detail::uint32_t; -using thrust::detail::uint64_t; +using THRUST_NS_QUALIFIER::detail::uint8_t; +using THRUST_NS_QUALIFIER::detail::uint16_t; +using THRUST_NS_QUALIFIER::detail::uint32_t; +using THRUST_NS_QUALIFIER::detail::uint64_t; } diff --git a/testing/unittest/testframework.h b/testing/unittest/testframework.h index 79ff8c7def..8d3813c5a8 100644 --- a/testing/unittest/testframework.h +++ b/testing/unittest/testframework.h @@ -228,8 +228,7 @@ class custom_numeric } }; -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template <> struct numeric_limits : numeric_limits {}; @@ -243,7 +242,9 @@ class integer_traits : public integer_traits_base {}; -}} // namespace thrust::detail +} // namespace detail + +THRUST_NAMESPACE_END typedef unittest::type_list // Use this with counting_iterator to avoid generating a range larger than we // can represent. template -typename thrust::detail::disable_if< - thrust::detail::is_floating_point::value +typename THRUST_NS_QUALIFIER::detail::disable_if< + THRUST_NS_QUALIFIER::detail::is_floating_point::value , T >::type truncate_to_max_representable(std::size_t n) { - return static_cast(thrust::min( + return static_cast(THRUST_NS_QUALIFIER::min( n, - static_cast(thrust::numeric_limits::max()))); + static_cast(THRUST_NS_QUALIFIER::numeric_limits::max()))); } // TODO: This probably won't work for `half`. template -typename thrust::detail::enable_if< - thrust::detail::is_floating_point::value +typename THRUST_NS_QUALIFIER::detail::enable_if< + THRUST_NS_QUALIFIER::detail::is_floating_point::value , T >::type truncate_to_max_representable(std::size_t n) { - return thrust::min(static_cast(n), thrust::numeric_limits::max()); + return THRUST_NS_QUALIFIER::min( + static_cast(n), + THRUST_NS_QUALIFIER::numeric_limits::max()); } } // end unittest diff --git a/thrust/addressof.h b/thrust/addressof.h index fa9e41c8ef..d21df0c76a 100644 --- a/thrust/addressof.h +++ b/thrust/addressof.h @@ -11,8 +11,7 @@ # include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /////////////////////////////////////////////////////////////////////////////// @@ -29,5 +28,4 @@ T* addressof(T& arg) /////////////////////////////////////////////////////////////////////////////// -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/adjacent_difference.h b/thrust/adjacent_difference.h index adddd7b2bb..e8385c240d 100644 --- a/thrust/adjacent_difference.h +++ b/thrust/adjacent_difference.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup transformations Transformations * \{ @@ -240,7 +238,7 @@ OutputIterator adjacent_difference(InputIterator first, InputIterator last, /*! \} */ -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/advance.h b/thrust/advance.h index 20d2c3908f..a5162e2030 100644 --- a/thrust/advance.h +++ b/thrust/advance.h @@ -23,8 +23,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -135,7 +134,7 @@ BidirectionalIterator prev( /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/allocate_unique.h b/thrust/allocate_unique.h index 6e67d1b18a..ff10cb51cd 100644 --- a/thrust/allocate_unique.h +++ b/thrust/allocate_unique.h @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // wg21.link/p0316r0 @@ -438,7 +437,7 @@ uninitialized_allocate_unique_n( /////////////////////////////////////////////////////////////////////////////// -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/async/copy.h b/thrust/async/copy.h index a6d792d55c..a88f46905b 100644 --- a/thrust/async/copy.h +++ b/thrust/async/copy.h @@ -32,8 +32,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace async { @@ -143,7 +142,7 @@ THRUST_INLINE_CONSTANT copy_detail::copy_fn copy{}; } // namespace async -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/async/for_each.h b/thrust/async/for_each.h index df8e141180..6d4c4130a6 100644 --- a/thrust/async/for_each.h +++ b/thrust/async/for_each.h @@ -32,8 +32,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace async { @@ -113,7 +112,6 @@ THRUST_INLINE_CONSTANT for_each_detail::for_each_fn for_each{}; } // namespace async -} // end namespace thrust +THRUST_NAMESPACE_END #endif - diff --git a/thrust/async/reduce.h b/thrust/async/reduce.h index da2b1195d0..57d955d164 100644 --- a/thrust/async/reduce.h +++ b/thrust/async/reduce.h @@ -34,8 +34,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace async { @@ -435,7 +434,7 @@ THRUST_INLINE_CONSTANT reduce_into_detail::reduce_into_fn reduce_into{}; } // namespace async -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/async/scan.h b/thrust/async/scan.h index 5c20f84810..1bcf812578 100644 --- a/thrust/async/scan.h +++ b/thrust/async/scan.h @@ -37,8 +37,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace async { @@ -340,6 +339,6 @@ THRUST_INLINE_CONSTANT exclusive_scan_detail::exclusive_scan_fn exclusive_scan{} } // namespace async -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/async/sort.h b/thrust/async/sort.h index c665c6467e..2820f75bdd 100644 --- a/thrust/async/sort.h +++ b/thrust/async/sort.h @@ -34,8 +34,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace async { @@ -269,7 +268,7 @@ THRUST_INLINE_CONSTANT sort_detail::sort_fn sort{}; } // namespace async -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/async/transform.h b/thrust/async/transform.h index 89687e93ad..59ea32661a 100644 --- a/thrust/async/transform.h +++ b/thrust/async/transform.h @@ -32,8 +32,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace async { @@ -128,7 +127,6 @@ THRUST_INLINE_CONSTANT transform_detail::transform_fn transform{}; } // namespace async -} // end namespace thrust +THRUST_NAMESPACE_END #endif - diff --git a/thrust/binary_search.h b/thrust/binary_search.h index c74a1ece07..7a4746e0b1 100644 --- a/thrust/binary_search.h +++ b/thrust/binary_search.h @@ -25,10 +25,8 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN - /*! \addtogroup algorithms */ @@ -1895,8 +1893,7 @@ OutputIterator binary_search(ForwardIterator first, /*! \} // end searching */ - -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/complex.h b/thrust/complex.h index badacb4679..ea3647ad56 100644 --- a/thrust/complex.h +++ b/thrust/complex.h @@ -44,8 +44,7 @@ # define THRUST_STD_COMPLEX_DEVICE #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /* * Calls to the standard math library from inside the thrust namespace @@ -1026,7 +1025,7 @@ template __host__ __device__ bool operator!=(const complex& x, const T1& y); -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/copy.h b/thrust/copy.h index 46e03ab1a7..99d488174d 100644 --- a/thrust/copy.h +++ b/thrust/copy.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -505,8 +504,8 @@ template #include diff --git a/thrust/count.h b/thrust/count.h index cd75afb71d..52b22d2055 100644 --- a/thrust/count.h +++ b/thrust/count.h @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -228,8 +226,6 @@ template * \} // end reductions */ - -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/detail/adjacent_difference.inl b/thrust/detail/adjacent_difference.inl index f8099450fd..5d7cc3ffad 100644 --- a/thrust/detail/adjacent_difference.inl +++ b/thrust/detail/adjacent_difference.inl @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -88,5 +86,4 @@ OutputIterator adjacent_difference(InputIterator first, InputIterator last, } // end adjacent_difference() -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/advance.inl b/thrust/detail/advance.inl index 2694a7ec69..09f3f0fd16 100644 --- a/thrust/detail/advance.inl +++ b/thrust/detail/advance.inl @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __THRUST_DEFINE_HAS_NESTED_TYPE(has_difference_type, difference_type) @@ -75,5 +74,4 @@ typename detail::disable_if< return i; } -} // namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/alignment.h b/thrust/detail/alignment.h index 89c8afcd8c..08f73501e0 100644 --- a/thrust/detail/alignment.h +++ b/thrust/detail/alignment.h @@ -29,8 +29,8 @@ #include // For `std::alignment_of` and `std::aligned_storage`. #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -226,5 +226,5 @@ inline std::size_t aligned_storage_size(std::size_t n, std::size_t align) } } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/allocator_traits.h b/thrust/detail/allocator/allocator_traits.h index c2557b57ef..cc710ed4a2 100644 --- a/thrust/detail/allocator/allocator_traits.h +++ b/thrust/detail/allocator/allocator_traits.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -416,7 +415,7 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/allocator_traits.inl b/thrust/detail/allocator/allocator_traits.inl index 0818941f69..1d8d92a9ca 100644 --- a/thrust/detail/allocator/allocator_traits.inl +++ b/thrust/detail/allocator/allocator_traits.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -460,5 +459,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/copy_construct_range.h b/thrust/detail/allocator/copy_construct_range.h index 491c8ef411..b3c2de3246 100644 --- a/thrust/detail/allocator/copy_construct_range.h +++ b/thrust/detail/allocator/copy_construct_range.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -41,7 +40,7 @@ __host__ __device__ Pointer result); } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/copy_construct_range.inl b/thrust/detail/allocator/copy_construct_range.inl index 2f0f03c361..6c879ca413 100644 --- a/thrust/detail/allocator/copy_construct_range.inl +++ b/thrust/detail/allocator/copy_construct_range.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace allocator_traits_detail @@ -305,5 +304,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/default_construct_range.h b/thrust/detail/allocator/default_construct_range.h index 6c3856c142..8b5026c05b 100644 --- a/thrust/detail/allocator/default_construct_range.h +++ b/thrust/detail/allocator/default_construct_range.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -30,7 +29,7 @@ inline void default_construct_range(Allocator &a, Pointer p, Size n); } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/default_construct_range.inl b/thrust/detail/allocator/default_construct_range.inl index 0f65d4806a..95ffb70ed7 100644 --- a/thrust/detail/allocator/default_construct_range.inl +++ b/thrust/detail/allocator/default_construct_range.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace allocator_traits_detail @@ -107,5 +106,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/destroy_range.h b/thrust/detail/allocator/destroy_range.h index bf00037cec..cfc7e3f6ef 100644 --- a/thrust/detail/allocator/destroy_range.h +++ b/thrust/detail/allocator/destroy_range.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -28,7 +27,7 @@ __host__ __device__ inline void destroy_range(Allocator &a, Pointer p, Size n); } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/destroy_range.inl b/thrust/detail/allocator/destroy_range.inl index f34159dc3d..934bd3e0e3 100644 --- a/thrust/detail/allocator/destroy_range.inl +++ b/thrust/detail/allocator/destroy_range.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace allocator_traits_detail @@ -160,5 +159,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/fill_construct_range.h b/thrust/detail/allocator/fill_construct_range.h index 9de0f7bcbb..a7572cb2d2 100644 --- a/thrust/detail/allocator/fill_construct_range.h +++ b/thrust/detail/allocator/fill_construct_range.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -30,7 +29,7 @@ inline void fill_construct_range(Allocator &a, Pointer p, Size n, const T &value } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/fill_construct_range.inl b/thrust/detail/allocator/fill_construct_range.inl index 7f2adafc7f..f5f8b72ea6 100644 --- a/thrust/detail/allocator/fill_construct_range.inl +++ b/thrust/detail/allocator/fill_construct_range.inl @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace allocator_traits_detail @@ -109,5 +108,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/malloc_allocator.h b/thrust/detail/allocator/malloc_allocator.h index 2c01c66bd0..af3d0fccbd 100644 --- a/thrust/detail/allocator/malloc_allocator.h +++ b/thrust/detail/allocator/malloc_allocator.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -46,7 +45,7 @@ template }; } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/malloc_allocator.inl b/thrust/detail/allocator/malloc_allocator.inl index e7b7503ba8..ff0ea8ec64 100644 --- a/thrust/detail/allocator/malloc_allocator.inl +++ b/thrust/detail/allocator/malloc_allocator.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -60,5 +59,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/no_throw_allocator.h b/thrust/detail/allocator/no_throw_allocator.h index ba8c3d8529..ea158d77f7 100644 --- a/thrust/detail/allocator/no_throw_allocator.h +++ b/thrust/detail/allocator/no_throw_allocator.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -66,6 +65,6 @@ template }; // end no_throw_allocator } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/tagged_allocator.h b/thrust/detail/allocator/tagged_allocator.h index a29115c6c1..804c4e42e5 100644 --- a/thrust/detail/allocator/tagged_allocator.h +++ b/thrust/detail/allocator/tagged_allocator.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -95,7 +94,7 @@ __host__ __device__ bool operator!=(const tagged_allocator &, const tagged_allocator &); } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/tagged_allocator.inl b/thrust/detail/allocator/tagged_allocator.inl index 5f4ed95968..e552dbca8e 100644 --- a/thrust/detail/allocator/tagged_allocator.inl +++ b/thrust/detail/allocator/tagged_allocator.inl @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -99,5 +98,5 @@ bool operator!=(const tagged_allocator &, const tagged_allocato } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator/temporary_allocator.h b/thrust/detail/allocator/temporary_allocator.h index 4d2ac429c9..c8ef606258 100644 --- a/thrust/detail/allocator/temporary_allocator.h +++ b/thrust/detail/allocator/temporary_allocator.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -79,7 +78,7 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/allocator/temporary_allocator.inl b/thrust/detail/allocator/temporary_allocator.inl index 673ed272f9..28056414bb 100644 --- a/thrust/detail/allocator/temporary_allocator.inl +++ b/thrust/detail/allocator/temporary_allocator.inl @@ -25,8 +25,7 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -71,5 +70,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/allocator_aware_execution_policy.h b/thrust/detail/allocator_aware_execution_policy.h index 28fd54f9b7..eea93c035e 100644 --- a/thrust/detail/allocator_aware_execution_policy.h +++ b/thrust/detail/allocator_aware_execution_policy.h @@ -24,8 +24,7 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -97,5 +96,6 @@ struct allocator_aware_execution_policy #endif }; -} -} +} // end namespace detail + +THRUST_NAMESPACE_END diff --git a/thrust/detail/binary_search.inl b/thrust/detail/binary_search.inl index 5703226dc8..b8826dfec4 100644 --- a/thrust/detail/binary_search.inl +++ b/thrust/detail/binary_search.inl @@ -26,9 +26,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -482,5 +480,4 @@ OutputIterator binary_search(ForwardIterator first, return thrust::binary_search(select_system(system1,system2,system3), first, last, values_first, values_last, output, comp); } -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/caching_allocator.h b/thrust/detail/caching_allocator.h index 13df1d33f9..5aa418200a 100644 --- a/thrust/detail/caching_allocator.h +++ b/thrust/detail/caching_allocator.h @@ -21,8 +21,8 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { inline @@ -42,4 +42,5 @@ thrust::mr::allocator< }; } } -} + +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/arithmetic.h b/thrust/detail/complex/arithmetic.h index 448166e98b..7561f34c76 100644 --- a/thrust/detail/complex/arithmetic.h +++ b/thrust/detail/complex/arithmetic.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /* --- Binary Arithmetic Operators --- */ @@ -296,5 +295,5 @@ polar(const T0& m, const T1& theta) return complex(m * cos(theta), m * sin(theta)); } -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/c99math.h b/thrust/detail/complex/c99math.h index 99748823b9..ad1609a68e 100644 --- a/thrust/detail/complex/c99math.h +++ b/thrust/detail/complex/c99math.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace complex @@ -192,5 +191,5 @@ inline double hypot(double x, double y){ } // namespace detail -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/catrig.h b/thrust/detail/complex/catrig.h index 6549fbb2ee..48068e85a2 100644 --- a/thrust/detail/complex/catrig.h +++ b/thrust/detail/complex/catrig.h @@ -54,7 +54,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -782,4 +782,4 @@ inline complex atanh(const complex& z){ } #endif -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/catrigf.h b/thrust/detail/complex/catrigf.h index aa924717a7..1847ebaa69 100644 --- a/thrust/detail/complex/catrigf.h +++ b/thrust/detail/complex/catrigf.h @@ -54,7 +54,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -497,4 +497,4 @@ inline complex atanh(const complex& z){ } #endif -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/ccosh.h b/thrust/detail/complex/ccosh.h index 300f08afc3..87e44c4ecf 100644 --- a/thrust/detail/complex/ccosh.h +++ b/thrust/detail/complex/ccosh.h @@ -50,7 +50,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -210,4 +210,4 @@ inline thrust::complex cosh(const thrust::complex& z){ return detail::complex::ccosh(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/ccoshf.h b/thrust/detail/complex/ccoshf.h index d33af7c4c7..f7c13d3e0e 100644 --- a/thrust/detail/complex/ccoshf.h +++ b/thrust/detail/complex/ccoshf.h @@ -51,7 +51,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -138,4 +138,4 @@ inline complex cosh(const complex& z){ return detail::complex::ccoshf(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/cexp.h b/thrust/detail/complex/cexp.h index 151df397bd..b7192b1e30 100644 --- a/thrust/detail/complex/cexp.h +++ b/thrust/detail/complex/cexp.h @@ -52,7 +52,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ /* @@ -180,4 +180,4 @@ inline complex exp(const complex& z){ return detail::complex::cexp(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/cexpf.h b/thrust/detail/complex/cexpf.h index 6d85c45ed8..eb97a4b9e4 100644 --- a/thrust/detail/complex/cexpf.h +++ b/thrust/detail/complex/cexpf.h @@ -52,7 +52,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -158,4 +158,4 @@ inline complex exp(const complex& z){ return detail::complex::cexpf(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/clog.h b/thrust/detail/complex/clog.h index 8d288df024..3499d0aa7c 100644 --- a/thrust/detail/complex/clog.h +++ b/thrust/detail/complex/clog.h @@ -49,7 +49,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -208,5 +208,5 @@ inline complex log10(const complex& z){ return thrust::log(z)/ValueType(2.30258509299404568402); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/clogf.h b/thrust/detail/complex/clogf.h index 7f3314ed26..6a1427a95c 100644 --- a/thrust/detail/complex/clogf.h +++ b/thrust/detail/complex/clogf.h @@ -48,7 +48,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -194,5 +194,5 @@ inline complex log(const complex& z){ return detail::complex::clogf(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/complex.inl b/thrust/detail/complex/complex.inl index 2e2a106bc8..f7ccf00628 100644 --- a/thrust/detail/complex/complex.inl +++ b/thrust/detail/complex/complex.inl @@ -19,8 +19,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /* --- Constructors --- */ @@ -330,7 +329,7 @@ bool operator!=(const complex& x, const T1& y) template struct proclaim_trivially_relocatable > : thrust::true_type {}; -} // end namespace thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/detail/complex/cpow.h b/thrust/detail/complex/cpow.h index 2d6ad051eb..a79852dc4d 100644 --- a/thrust/detail/complex/cpow.h +++ b/thrust/detail/complex/cpow.h @@ -20,7 +20,7 @@ #include #include -namespace thrust { +THRUST_NAMESPACE_BEGIN template __host__ __device__ @@ -51,5 +51,5 @@ pow(const T0& x, const complex& y) return exp(log(T(x)) * complex(y)); } -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/cproj.h b/thrust/detail/complex/cproj.h index 563c92f697..e1fdb3ed9a 100644 --- a/thrust/detail/complex/cproj.h +++ b/thrust/detail/complex/cproj.h @@ -21,7 +21,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ __host__ __device__ @@ -67,5 +67,4 @@ inline thrust::complex proj(const thrust::complex& z){ return detail::complex::cprojf(z); } -} - +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/csinh.h b/thrust/detail/complex/csinh.h index 869f367f26..ad1dbb5639 100644 --- a/thrust/detail/complex/csinh.h +++ b/thrust/detail/complex/csinh.h @@ -51,7 +51,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -202,4 +202,4 @@ inline complex sinh(const complex& z){ return detail::complex::csinh(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/csinhf.h b/thrust/detail/complex/csinhf.h index bf4fb08164..274886a21c 100644 --- a/thrust/detail/complex/csinhf.h +++ b/thrust/detail/complex/csinhf.h @@ -51,7 +51,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -139,4 +139,4 @@ inline complex sinh(const complex& z){ return detail::complex::csinhf(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/csqrt.h b/thrust/detail/complex/csqrt.h index dcffbee954..9757c704a2 100644 --- a/thrust/detail/complex/csqrt.h +++ b/thrust/detail/complex/csqrt.h @@ -53,7 +53,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -149,4 +149,4 @@ inline complex sqrt(const complex& z){ return detail::complex::csqrt(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/csqrtf.h b/thrust/detail/complex/csqrtf.h index 125d4b60d7..f477d3c28c 100644 --- a/thrust/detail/complex/csqrtf.h +++ b/thrust/detail/complex/csqrtf.h @@ -53,7 +53,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -144,4 +144,4 @@ inline complex sqrt(const complex& z){ return detail::complex::csqrtf(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/ctanh.h b/thrust/detail/complex/ctanh.h index 6ef1590920..9f8ba907ca 100644 --- a/thrust/detail/complex/ctanh.h +++ b/thrust/detail/complex/ctanh.h @@ -91,7 +91,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -197,4 +197,4 @@ inline complex tanh(const complex& z){ return detail::complex::ctanh(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/ctanhf.h b/thrust/detail/complex/ctanhf.h index f6923d1df6..51071f7208 100644 --- a/thrust/detail/complex/ctanhf.h +++ b/thrust/detail/complex/ctanhf.h @@ -56,7 +56,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -121,4 +121,4 @@ inline complex tanh(const complex& z){ return detail::complex::ctanhf(z); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/complex/math_private.h b/thrust/detail/complex/math_private.h index bc2d6357f2..3a40c8e729 100644 --- a/thrust/detail/complex/math_private.h +++ b/thrust/detail/complex/math_private.h @@ -35,7 +35,7 @@ #include #include -namespace thrust{ +THRUST_NAMESPACE_BEGIN namespace detail{ namespace complex{ @@ -130,7 +130,7 @@ void extract_words(int32_t & ix0,int32_t & ix1, double d){ } // namespace detail -} // namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/complex/stream.h b/thrust/detail/complex/stream.h index 9d87bbd548..3c10ddae8a 100644 --- a/thrust/detail/complex/stream.h +++ b/thrust/detail/complex/stream.h @@ -17,8 +17,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template std::basic_ostream& operator<<(std::basic_ostream& os, const complex& z) { @@ -68,4 +67,4 @@ operator>>(std::basic_istream& is, complex& z) return is; } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/config/config.h b/thrust/detail/config/config.h index 800bc4c51a..797f6605b0 100644 --- a/thrust/detail/config/config.h +++ b/thrust/detail/config/config.h @@ -36,4 +36,5 @@ #include #include #include +#include diff --git a/thrust/detail/config/memory_resource.h b/thrust/detail/config/memory_resource.h index 4cfc50d3e4..ab719c9bde 100644 --- a/thrust/detail/config/memory_resource.h +++ b/thrust/detail/config/memory_resource.h @@ -22,7 +22,7 @@ #include #include -#define THRUST_MR_DEFAULT_ALIGNMENT THRUST_ALIGNOF(::thrust::detail::max_align_t) +#define THRUST_MR_DEFAULT_ALIGNMENT THRUST_ALIGNOF(THRUST_NS_QUALIFIER::detail::max_align_t) #if THRUST_CPP_DIALECT >= 2017 # if __has_include() @@ -33,4 +33,3 @@ # define THRUST_MR_STD_MR_NS std::experimental::pmr # endif #endif - diff --git a/thrust/detail/config/namespace.h b/thrust/detail/config/namespace.h new file mode 100644 index 0000000000..9c79046169 --- /dev/null +++ b/thrust/detail/config/namespace.h @@ -0,0 +1,120 @@ +/* + * 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 + +/** + * \file namespace.h + * \brief Utilities that allow `thrust::` to be placed inside an + * application-specific namespace. + */ + +/** + * \def THRUST_CUB_WRAPPED_NAMESPACE + * If defined, this value will be used as the name of a namespace that wraps the + * `thrust::` and `cub::` namespaces. + * This macro should not be used with any other Thrust namespace macros. + */ +#ifdef THRUST_CUB_WRAPPED_NAMESPACE +#define THRUST_WRAPPED_NAMESPACE THRUST_CUB_WRAPPED_NAMESPACE +#endif + +/** + * \def THRUST_WRAPPED_NAMESPACE + * If defined, this value will be used as the name of a namespace that wraps the + * `thrust::` namespace. + * If THRUST_CUB_WRAPPED_NAMESPACE is set, this will inherit that macro's value. + * This macro should not be used with any other Thrust namespace macros. + */ +#ifdef THRUST_WRAPPED_NAMESPACE +#define THRUST_NS_PREFIX \ + namespace THRUST_WRAPPED_NAMESPACE \ + { + +#define THRUST_NS_POSTFIX } + +#define THRUST_NS_QUALIFIER ::THRUST_WRAPPED_NAMESPACE::thrust +#endif + +/** + * \def THRUST_NS_PREFIX + * This macro is inserted prior to all `namespace thrust { ... }` blocks. It is + * derived from THRUST_WRAPPED_NAMESPACE, if set, and will be empty otherwise. + * It may be defined by users, in which case THRUST_NS_PREFIX, + * THRUST_NS_POSTFIX, and THRUST_NS_QUALIFIER must all be set consistently. + */ +#ifndef THRUST_NS_PREFIX +#define THRUST_NS_PREFIX +#endif + +/** + * \def THRUST_NS_POSTFIX + * This macro is inserted following the closing braces of all + * `namespace thrust { ... }` block. It is defined appropriately when + * THRUST_WRAPPED_NAMESPACE is set, and will be empty otherwise. It may be + * defined by users, in which case THRUST_NS_PREFIX, THRUST_NS_POSTFIX, and + * THRUST_NS_QUALIFIER must all be set consistently. + */ +#ifndef THRUST_NS_POSTFIX +#define THRUST_NS_POSTFIX +#endif + +/** + * \def THRUST_NS_QUALIFIER + * This macro is used to qualify members of thrust:: when accessing them from + * outside of their namespace. By default, this is just `::thrust`, and will be + * set appropriately when THRUST_WRAPPED_NAMESPACE is defined. This macro may be + * defined by users, in which case THRUST_NS_PREFIX, THRUST_NS_POSTFIX, and + * THRUST_NS_QUALIFIER must all be set consistently. + */ +#ifndef THRUST_NS_QUALIFIER +#define THRUST_NS_QUALIFIER ::thrust +#endif + +/** + * \def THRUST_NAMESPACE_BEGIN + * This macro is used to open a `thrust::` namespace block, along with any + * enclosing namespaces requested by THRUST_WRAPPED_NAMESPACE, etc. + * This macro is defined by Thrust and may not be overridden. + */ +#define THRUST_NAMESPACE_BEGIN \ + THRUST_NS_PREFIX \ + namespace thrust \ + { + +/** + * \def THRUST_NAMESPACE_END + * This macro is used to close a `thrust::` namespace block, along with any + * enclosing namespaces requested by THRUST_WRAPPED_NAMESPACE, etc. + * This macro is defined by Thrust and may not be overridden. + */ +#define THRUST_NAMESPACE_END \ + } /* end namespace thrust */ \ + THRUST_NS_POSTFIX + +// The following is just here to add docs for the thrust namespace: + +THRUST_NS_PREFIX + +/*! \namespace thrust + * \brief \p thrust is the top-level namespace which contains all Thrust + * functions and types. + */ +namespace thrust +{ +} + +THRUST_NS_POSTFIX diff --git a/thrust/detail/contiguous_storage.h b/thrust/detail/contiguous_storage.h index a128223a99..536c1c27c2 100644 --- a/thrust/detail/contiguous_storage.h +++ b/thrust/detail/contiguous_storage.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -230,7 +229,7 @@ template __host__ __device__ void swap(detail::contiguous_storage &lhs, detail::contiguous_storage &rhs); -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/contiguous_storage.inl b/thrust/detail/contiguous_storage.inl index 89f78e0b22..b82b833994 100644 --- a/thrust/detail/contiguous_storage.inl +++ b/thrust/detail/contiguous_storage.inl @@ -28,8 +28,7 @@ #include // for std::runtime_error #include // for use of std::swap in the WAR below -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -549,5 +548,4 @@ __host__ __device__ lhs.swap(rhs); } // end swap() -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/copy.h b/thrust/detail/copy.h index 5e9feb0f90..d6c5bc805c 100644 --- a/thrust/detail/copy.h +++ b/thrust/detail/copy.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template +THRUST_NAMESPACE_END +#include diff --git a/thrust/detail/copy.inl b/thrust/detail/copy.inl index 85701fde72..125037f122 100644 --- a/thrust/detail/copy.inl +++ b/thrust/detail/copy.inl @@ -21,9 +21,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -127,6 +125,4 @@ template #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN template - diff --git a/thrust/detail/copy_if.inl b/thrust/detail/copy_if.inl index f4c22f8a50..83c1237fd9 100644 --- a/thrust/detail/copy_if.inl +++ b/thrust/detail/copy_if.inl @@ -21,9 +21,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -79,6 +77,4 @@ count_if(InputIterator first, InputIterator last, Predicate pred) return thrust::count_if(select_system(system), first, last, pred); } // end count_if() - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/cstdint.h b/thrust/detail/cstdint.h index 248390a528..b17c55f289 100644 --- a/thrust/detail/cstdint.h +++ b/thrust/detail/cstdint.h @@ -20,8 +20,8 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -75,5 +75,5 @@ typedef divine_intptr_t<>::type intptr_t; typedef divine_uintptr_t<>::type uintptr_t; } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/dependencies_aware_execution_policy.h b/thrust/detail/dependencies_aware_execution_policy.h index 1806276f9d..a7567a3fab 100644 --- a/thrust/detail/dependencies_aware_execution_policy.h +++ b/thrust/detail/dependencies_aware_execution_policy.h @@ -25,8 +25,8 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -99,7 +99,8 @@ struct dependencies_aware_execution_policy }; } // end detail -} // end thrust + +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/detail/device_delete.inl b/thrust/detail/device_delete.inl index f1a67f91be..b40bb702a8 100644 --- a/thrust/detail/device_delete.inl +++ b/thrust/detail/device_delete.inl @@ -23,8 +23,8 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -43,5 +43,4 @@ template thrust::device_free(ptr); } // end device_delete() -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/device_free.inl b/thrust/detail/device_free.inl index 7a1b6c1239..2f2cf8730c 100644 --- a/thrust/detail/device_free.inl +++ b/thrust/detail/device_free.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN void device_free(thrust::device_ptr ptr) { @@ -40,5 +39,4 @@ void device_free(thrust::device_ptr ptr) thrust::free(s, ptr); } // end device_free() -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/device_malloc.inl b/thrust/detail/device_malloc.inl index 938c3c807c..b40db02b18 100644 --- a/thrust/detail/device_malloc.inl +++ b/thrust/detail/device_malloc.inl @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN thrust::device_ptr device_malloc(const std::size_t n) { @@ -55,6 +53,4 @@ template return thrust::device_ptr(thrust::malloc(s,n).get()); } // end device_malloc() - -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/device_new.inl b/thrust/detail/device_new.inl index 2551badb43..9eabcdc0a4 100644 --- a/thrust/detail/device_new.inl +++ b/thrust/detail/device_new.inl @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template device_ptr device_new(device_ptr p, @@ -56,5 +55,4 @@ template return device_new(thrust::device_malloc(n)); } // end device_new() -} // thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/device_ptr.inl b/thrust/detail/device_ptr.inl index d1058ca6aa..f0c95b8de7 100644 --- a/thrust/detail/device_ptr.inl +++ b/thrust/detail/device_ptr.inl @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template __host__ __device__ @@ -63,5 +62,5 @@ template } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/distance.inl b/thrust/detail/distance.inl index f12ef204cc..2b0e0a0d35 100644 --- a/thrust/detail/distance.inl +++ b/thrust/detail/distance.inl @@ -23,9 +23,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -36,6 +34,4 @@ inline __host__ __device__ return thrust::system::detail::generic::distance(first, last); } // end distance() - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/equal.inl b/thrust/detail/equal.inl index 08bfbab0be..6d7cc24a91 100644 --- a/thrust/detail/equal.inl +++ b/thrust/detail/equal.inl @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -81,6 +79,4 @@ bool equal(InputIterator1 first1, InputIterator1 last1, return thrust::equal(select_system(system1,system2), first1, last1, first2, binary_pred); } - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/event_error.h b/thrust/detail/event_error.h index cd4d8e7d9b..b928e0650c 100644 --- a/thrust/detail/event_error.h +++ b/thrust/detail/event_error.h @@ -29,8 +29,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN enum class event_errc { @@ -159,7 +158,7 @@ inline bool operator<(event_error const& lhs, event_error const& rhs) noexcept return lhs.code() < rhs.code(); } -} // end namespace thrust +THRUST_NAMESPACE_END #endif // C++14 diff --git a/thrust/detail/execute_with_allocator.h b/thrust/detail/execute_with_allocator.h index 93dee663cc..430fe739c3 100644 --- a/thrust/detail/execute_with_allocator.h +++ b/thrust/detail/execute_with_allocator.h @@ -25,8 +25,8 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -144,5 +144,6 @@ return_temporary_buffer( #endif -}} // namespace thrust::detail +} // namespace detail +THRUST_NAMESPACE_END diff --git a/thrust/detail/execute_with_allocator_fwd.h b/thrust/detail/execute_with_allocator_fwd.h index 22d78fdd6b..1d5899a7db 100644 --- a/thrust/detail/execute_with_allocator_fwd.h +++ b/thrust/detail/execute_with_allocator_fwd.h @@ -24,8 +24,8 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -101,4 +101,6 @@ struct execute_with_allocator #endif }; -}} // namespace thrust::detail +} // namespace detail + +THRUST_NAMESPACE_END diff --git a/thrust/detail/execute_with_dependencies.h b/thrust/detail/execute_with_dependencies.h index cb92b1ba2b..ec54010b05 100644 --- a/thrust/detail/execute_with_dependencies.h +++ b/thrust/detail/execute_with_dependencies.h @@ -27,8 +27,8 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -261,7 +261,7 @@ extract_dependencies(System &&) } } // end detail -} // end thrust -#endif // THRUST_CPP_DIALECT >= 2011 +THRUST_NAMESPACE_END +#endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/detail/execution_policy.h b/thrust/detail/execution_policy.h index e410d8c285..dcc11a7703 100644 --- a/thrust/detail/execution_policy.h +++ b/thrust/detail/execution_policy.h @@ -18,8 +18,8 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -73,5 +73,4 @@ template : thrust::detail::execution_policy_base {}; -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/extrema.inl b/thrust/detail/extrema.inl index 3f60743e64..91b6da7398 100644 --- a/thrust/detail/extrema.inl +++ b/thrust/detail/extrema.inl @@ -22,9 +22,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -167,6 +165,4 @@ minmax_element(ForwardIterator first, ForwardIterator last, BinaryPredicate comp return thrust::minmax_element(select_system(system), first, last, comp); } // end minmax_element() - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/fill.inl b/thrust/detail/fill.inl index 6e957ca1f9..560904d05b 100644 --- a/thrust/detail/fill.inl +++ b/thrust/detail/fill.inl @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -86,6 +84,4 @@ __host__ __device__ return thrust::fill_n(select_system(system), first, n, value); } // end fill() - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/find.inl b/thrust/detail/find.inl index f42ff46506..f024960dc0 100644 --- a/thrust/detail/find.inl +++ b/thrust/detail/find.inl @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -74,11 +72,11 @@ InputIterator find(InputIterator first, const T& value) { using thrust::system::detail::generic::select_system; - + typedef typename thrust::iterator_system::type System; - + System system; - + return thrust::find(select_system(system), first, last, value); } @@ -88,11 +86,11 @@ InputIterator find_if(InputIterator first, Predicate pred) { using thrust::system::detail::generic::select_system; - + typedef typename thrust::iterator_system::type System; - + System system; - + return thrust::find_if(select_system(system), first, last, pred); } @@ -102,14 +100,12 @@ InputIterator find_if_not(InputIterator first, Predicate pred) { using thrust::system::detail::generic::select_system; - + typedef typename thrust::iterator_system::type System; - + System system; - + return thrust::find_if_not(select_system(system), first, last, pred); } - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/for_each.inl b/thrust/detail/for_each.inl index 3365ce2e0f..d4a36e27f7 100644 --- a/thrust/detail/for_each.inl +++ b/thrust/detail/for_each.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -157,4 +157,5 @@ struct wrapped_function }; // end wrapped_function } // namespace detail -} // namespace thrust + +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional.inl b/thrust/detail/functional.inl index ea13227978..031c462f87 100644 --- a/thrust/detail/functional.inl +++ b/thrust/detail/functional.inl @@ -16,8 +16,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -120,5 +119,4 @@ template return binary_negate(pred); } // end not2() -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/actor.h b/thrust/detail/functional/actor.h index 7511206627..cee0770a46 100644 --- a/thrust/detail/functional/actor.h +++ b/thrust/detail/functional/actor.h @@ -33,8 +33,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -150,7 +149,7 @@ template }; // end result_of } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/functional/actor.inl b/thrust/detail/functional/actor.inl index f4588b8007..d8a5c9f5a9 100644 --- a/thrust/detail/functional/actor.inl +++ b/thrust/detail/functional/actor.inl @@ -31,8 +31,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -110,4 +109,4 @@ template } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/argument.h b/thrust/detail/functional/argument.h index 6940ddad1b..aac29f5371 100644 --- a/thrust/detail/functional/argument.h +++ b/thrust/detail/functional/argument.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -71,5 +70,5 @@ template } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/composite.h b/thrust/detail/functional/composite.h index 6cf095bf11..9a4c8a9272 100644 --- a/thrust/detail/functional/composite.h +++ b/thrust/detail/functional/composite.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -159,5 +158,5 @@ __host__ __device__ } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/arithmetic_operators.h b/thrust/detail/functional/operators/arithmetic_operators.h index bd5b707e3b..d8c962a3a1 100644 --- a/thrust/detail/functional/operators/arithmetic_operators.h +++ b/thrust/detail/functional/operators/arithmetic_operators.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -428,5 +427,5 @@ operator--(const actor &_1, int) } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/assignment_operator.h b/thrust/detail/functional/operators/assignment_operator.h index a2f18339bc..950e335f44 100644 --- a/thrust/detail/functional/operators/assignment_operator.h +++ b/thrust/detail/functional/operators/assignment_operator.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // XXX WAR circular inclusion with this forward declaration template struct binary_function; @@ -76,5 +75,5 @@ template } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/bitwise_operators.h b/thrust/detail/functional/operators/bitwise_operators.h index a6461f9d49..38f4bf72a9 100644 --- a/thrust/detail/functional/operators/bitwise_operators.h +++ b/thrust/detail/functional/operators/bitwise_operators.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -334,5 +333,5 @@ operator>>(const actor &_1, const actor &_2) } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/compound_assignment_operators.h b/thrust/detail/functional/operators/compound_assignment_operators.h index 737d6abd09..2324869bf9 100644 --- a/thrust/detail/functional/operators/compound_assignment_operators.h +++ b/thrust/detail/functional/operators/compound_assignment_operators.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -509,5 +508,5 @@ operator>>=(const actor &_1, const actor &_2) } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/logical_operators.h b/thrust/detail/functional/operators/logical_operators.h index 85a2e5e040..e1e4ff7199 100644 --- a/thrust/detail/functional/operators/logical_operators.h +++ b/thrust/detail/functional/operators/logical_operators.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -140,5 +139,5 @@ operator!(const actor &_1) } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/operator_adaptors.h b/thrust/detail/functional/operators/operator_adaptors.h index 67a1f6e37d..67326c5c1e 100644 --- a/thrust/detail/functional/operators/operator_adaptors.h +++ b/thrust/detail/functional/operators/operator_adaptors.h @@ -25,8 +25,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -133,5 +132,5 @@ struct transparent_binary_operator } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/operators/relational_operators.h b/thrust/detail/functional/operators/relational_operators.h index 51fd4640a2..6c58325e22 100644 --- a/thrust/detail/functional/operators/relational_operators.h +++ b/thrust/detail/functional/operators/relational_operators.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -319,5 +318,5 @@ operator<=(const actor &_1, const actor &_2) } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/placeholder.h b/thrust/detail/functional/placeholder.h index d0832cfecb..e3c0835531 100644 --- a/thrust/detail/functional/placeholder.h +++ b/thrust/detail/functional/placeholder.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -35,5 +34,5 @@ template } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/functional/value.h b/thrust/detail/functional/value.h index 27a584676f..d6b1563b15 100644 --- a/thrust/detail/functional/value.h +++ b/thrust/detail/functional/value.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace functional @@ -76,5 +75,5 @@ actor > val(const T &x) } // end functional } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/gather.inl b/thrust/detail/gather.inl index 4550742c5f..8fbee3f14b 100644 --- a/thrust/detail/gather.inl +++ b/thrust/detail/gather.inl @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template #include // for get_value() -namespace thrust { +THRUST_NAMESPACE_BEGIN + namespace detail { // get_iterator_value specialization on iterators @@ -50,4 +51,5 @@ get_iterator_value(thrust::execution_policy &exec, Pointer* ptr) } // get_iterator_value(exec,Pointer*) } // namespace detail -} // namespace thrust + +THRUST_NAMESPACE_END diff --git a/thrust/detail/inner_product.inl b/thrust/detail/inner_product.inl index 37247e68ee..c431ed4310 100644 --- a/thrust/detail/inner_product.inl +++ b/thrust/detail/inner_product.inl @@ -26,9 +26,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -151,5 +151,5 @@ Integer0 round_z(Integer0 const x, Integer1 const y) #endif } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/integer_traits.h b/thrust/detail/integer_traits.h index 97ab4f94da..853af20b86 100644 --- a/thrust/detail/integer_traits.h +++ b/thrust/detail/integer_traits.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -30,16 +29,16 @@ template class integer_traits { public: - static const bool is_integral = false; + static constexpr bool is_integral = false; }; template class integer_traits_base { public: - static const bool is_integral = true; - static const T const_min = min_val; - static const T const_max = max_val; + static constexpr bool is_integral = true; + static constexpr T const_min = min_val; + static constexpr T const_max = max_val; }; @@ -128,5 +127,4 @@ template<> } // end detail -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/internal_functional.h b/thrust/detail/internal_functional.h index dba2f8f793..fcbe91473b 100644 --- a/thrust/detail/internal_functional.h +++ b/thrust/detail/internal_functional.h @@ -29,8 +29,8 @@ #include #include // for ::new -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -553,5 +553,5 @@ template } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/logical.inl b/thrust/detail/logical.inl index 2f428bc5ff..e6d9e4f36c 100644 --- a/thrust/detail/logical.inl +++ b/thrust/detail/logical.inl @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -97,6 +95,4 @@ bool none_of(InputIterator first, InputIterator last, Predicate pred) return thrust::none_of(select_system(system), first, last, pred); } - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/malloc_and_free.h b/thrust/detail/malloc_and_free.h index 6dc238adb4..1435188931 100644 --- a/thrust/detail/malloc_and_free.h +++ b/thrust/detail/malloc_and_free.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -81,5 +80,4 @@ void free(const thrust::detail::execution_policy_base &exec, Poin // XXX consider another form of free which does not take a system argument and // instead infers the system from the pointer -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/memory_algorithms.h b/thrust/detail/memory_algorithms.h index ffa25aff8b..bc50f307cb 100644 --- a/thrust/detail/memory_algorithms.h +++ b/thrust/detail/memory_algorithms.h @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /////////////////////////////////////////////////////////////////////////////// @@ -206,5 +205,4 @@ void uninitialized_construct_n_with_allocator( /////////////////////////////////////////////////////////////////////////////// -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/merge.inl b/thrust/detail/merge.inl index d424757097..4b0ce934ba 100644 --- a/thrust/detail/merge.inl +++ b/thrust/detail/merge.inl @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN template __host__ __device__ @@ -50,6 +48,4 @@ __host__ __device__ return lhs < rhs ? rhs : lhs; } // end max() - -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/mismatch.inl b/thrust/detail/mismatch.inl index 6c39aab86b..e211fa37ad 100644 --- a/thrust/detail/mismatch.inl +++ b/thrust/detail/mismatch.inl @@ -27,9 +27,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -92,6 +90,4 @@ thrust::pair mismatch(InputIterator1 first1, return thrust::mismatch(select_system(system1,system2), first1, last1, first2, pred); } // end mismatch() - -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/mpl/math.h b/thrust/detail/mpl/math.h index 5356c9c155..b6b5b98728 100644 --- a/thrust/detail/mpl/math.h +++ b/thrust/detail/mpl/math.h @@ -22,8 +22,7 @@ #pragma once -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -170,5 +169,5 @@ template } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/numeric_traits.h b/thrust/detail/numeric_traits.h index 168b9ad0f4..f4ac8fe9ca 100644 --- a/thrust/detail/numeric_traits.h +++ b/thrust/detail/numeric_traits.h @@ -21,8 +21,7 @@ //#include // for intmax_t (not provided on MSVS 2005) -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -126,5 +125,4 @@ numeric_distance(Number x, Number y) } // end detail -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/overlapped_copy.h b/thrust/detail/overlapped_copy.h index f6bb85a911..418497de8d 100644 --- a/thrust/detail/overlapped_copy.h +++ b/thrust/detail/overlapped_copy.h @@ -23,8 +23,8 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + namespace detail { @@ -127,5 +127,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template __host__ __device__ @@ -224,6 +223,4 @@ template return detail::pair_get >()(p); } // end get() - -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/partition.inl b/thrust/detail/partition.inl index a667264c63..db39c0513f 100644 --- a/thrust/detail/partition.inl +++ b/thrust/detail/partition.inl @@ -26,9 +26,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template return thrust::is_partitioned(select_system(system), first, last, pred); } // end is_partitioned() - -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/pointer.h b/thrust/detail/pointer.h index 72cf184c6d..da8686f5ef 100644 --- a/thrust/detail/pointer.h +++ b/thrust/detail/pointer.h @@ -25,9 +25,7 @@ #include #include - -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class pointer; @@ -46,15 +44,15 @@ struct iterator_traits> using reference = typename pointer::reference; }; -} // namespace thrust +THRUST_NAMESPACE_END namespace std { template -struct iterator_traits> +struct iterator_traits> { - using pointer = thrust::pointer; + using pointer = THRUST_NS_QUALIFIER::pointer; using iterator_category = typename pointer::iterator_category; using value_type = typename pointer::value_type; using difference_type = typename pointer::difference_type; @@ -63,7 +61,9 @@ struct iterator_traits> } // namespace std -namespace thrust { namespace detail +THRUST_NAMESPACE_BEGIN + +namespace detail { // this metafunction computes the type of iterator_adaptor thrust::pointer should inherit from @@ -243,7 +243,7 @@ template __host__ __device__ bool operator!=(pointer p, decltype(nullptr)); -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/pointer.inl b/thrust/detail/pointer.inl index bd5e340db2..8af2891987 100644 --- a/thrust/detail/pointer.inl +++ b/thrust/detail/pointer.inl @@ -18,10 +18,7 @@ #include #include - -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN template __host__ __device__ @@ -206,5 +203,4 @@ bool operator!=(pointer p, decltype(nullptr)) return !(nullptr == p); } -} // namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/range/head_flags.h b/thrust/detail/range/head_flags.h index b193651cfd..b755840c99 100644 --- a/thrust/detail/range/head_flags.h +++ b/thrust/detail/range/head_flags.h @@ -24,8 +24,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -226,5 +225,5 @@ head_flags } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/range/tail_flags.h b/thrust/detail/range/tail_flags.h index 32ccb53c6a..41ee5dd29c 100644 --- a/thrust/detail/range/tail_flags.h +++ b/thrust/detail/range/tail_flags.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -130,5 +129,5 @@ tail_flags } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/raw_pointer_cast.h b/thrust/detail/raw_pointer_cast.h index 33f87849d7..53a77861ef 100644 --- a/thrust/detail/raw_pointer_cast.h +++ b/thrust/detail/raw_pointer_cast.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template __host__ __device__ @@ -48,5 +47,4 @@ static_pointer_cast(FromPointer ptr) return ToPointer(static_cast(thrust::raw_pointer_cast(ptr))); } -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/detail/raw_reference_cast.h b/thrust/detail/raw_reference_cast.h index aea317c521..8a77edfea4 100644 --- a/thrust/detail/raw_reference_cast.h +++ b/thrust/detail/raw_reference_cast.h @@ -29,8 +29,7 @@ // raw_reference_cast depends on metafunctions such as is_unwrappable and raw_reference // we need to be sure that these metafunctions are completely defined (including specializations) before they are instantiated by raw_reference_cast -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -329,5 +328,5 @@ raw_reference_cast(thrust::detail::tuple_of_iterator_references t) } // end raw_reference_cast -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/reduce.inl b/thrust/detail/reduce.inl index 2ecedc7a2c..401d4ea95b 100644 --- a/thrust/detail/reduce.inl +++ b/thrust/detail/reduce.inl @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -274,5 +273,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -507,5 +506,5 @@ void swap(tagged_reference& x, tagged_reference& y) x.swap(y); } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/reference_forward_declaration.h b/thrust/detail/reference_forward_declaration.h index aa0168e535..6f2b999497 100644 --- a/thrust/detail/reference_forward_declaration.h +++ b/thrust/detail/reference_forward_declaration.h @@ -19,11 +19,10 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class reference; -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/remove.inl b/thrust/detail/remove.inl index f5951fa91d..f77b35e89c 100644 --- a/thrust/detail/remove.inl +++ b/thrust/detail/remove.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -246,5 +245,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -218,5 +217,5 @@ template } // end replace() -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/reverse.inl b/thrust/detail/reverse.inl index e8a018cd68..6d67042549 100644 --- a/thrust/detail/reverse.inl +++ b/thrust/detail/reverse.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -87,5 +86,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -522,5 +521,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -161,6 +160,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -79,7 +78,7 @@ THRUST_INLINE_CONSTANT select_system_detail::select_system_fn select_system{}; } // detail -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/detail/seq.h b/thrust/detail/seq.h index 8268ad05a8..ba18c2dbf5 100644 --- a/thrust/detail/seq.h +++ b/thrust/detail/seq.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -48,6 +47,6 @@ struct seq_t : thrust::system::detail::sequential::execution_policy, THRUST_INLINE_CONSTANT detail::seq_t seq; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/sequence.inl b/thrust/detail/sequence.inl index fff7cbb633..681fe64143 100644 --- a/thrust/detail/sequence.inl +++ b/thrust/detail/sequence.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -114,5 +113,5 @@ template } // end sequence() -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/set_operations.inl b/thrust/detail/set_operations.inl index 42cf5ed359..e44c16f86f 100644 --- a/thrust/detail/set_operations.inl +++ b/thrust/detail/set_operations.inl @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -864,5 +863,5 @@ template #include -namespace thrust { +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -80,6 +80,6 @@ __host__ __device__ void shuffle_copy(RandomIterator first, RandomIterator last, result, g); } -} // namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/detail/sort.inl b/thrust/detail/sort.inl index d4a7901e6c..8b25f390dd 100644 --- a/thrust/detail/sort.inl +++ b/thrust/detail/sort.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -404,5 +403,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -66,16 +65,16 @@ template struct static_assert_test {}; // Clang and GCC 4.8+ will complain about this typedef being unused unless we // annotate it as such. # define THRUST_STATIC_ASSERT(B) \ - typedef ::thrust::detail::static_assert_test< \ - sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE<(bool)(B)>) \ + typedef THRUST_NS_QUALIFIER::detail::static_assert_test< \ + sizeof(THRUST_NS_QUALIFIER::detail::STATIC_ASSERTION_FAILURE<(bool)(B)>)\ > \ THRUST_PP_CAT2(thrust_static_assert_typedef_, __LINE__) \ __attribute__((unused)) \ /**/ #else # define THRUST_STATIC_ASSERT(B) \ - typedef ::thrust::detail::static_assert_test< \ - sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE<(bool)(B)>) \ + typedef THRUST_NS_QUALIFIER::detail::static_assert_test< \ + sizeof(THRUST_NS_QUALIFIER::detail::STATIC_ASSERTION_FAILURE<(bool)(B)>)\ > \ THRUST_PP_CAT2(thrust_static_assert_typedef_, __LINE__) \ /**/ @@ -87,6 +86,6 @@ template struct static_assert_test {}; } // namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/static_map.h b/thrust/detail/static_map.h index 872a73aefd..9f0d79e83e 100644 --- a/thrust/detail/static_map.h +++ b/thrust/detail/static_map.h @@ -20,8 +20,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace static_map_detail @@ -166,5 +165,5 @@ unsigned int lookup(unsigned int key) } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/swap.h b/thrust/detail/swap.h index 96783c762b..305750f8ae 100644 --- a/thrust/detail/swap.h +++ b/thrust/detail/swap.h @@ -19,8 +19,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ template @@ -32,5 +31,5 @@ inline void swap(Assignable1 &a, Assignable2 &b) b = temp; } // end swap() -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/swap_ranges.inl b/thrust/detail/swap_ranges.inl index 8ed97cc740..acca248604 100644 --- a/thrust/detail/swap_ranges.inl +++ b/thrust/detail/swap_ranges.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -62,5 +61,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -53,5 +52,5 @@ template } // end tabulate() -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/temporary_array.h b/thrust/detail/temporary_array.h index 8f41200839..c5f61cc92b 100644 --- a/thrust/detail/temporary_array.h +++ b/thrust/detail/temporary_array.h @@ -20,8 +20,7 @@ #pragma once -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -31,7 +30,7 @@ template class temporary_array; } // end detail -} // end thrust +THRUST_NAMESPACE_END #include #include @@ -41,8 +40,7 @@ template #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -175,7 +173,7 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/temporary_array.inl b/thrust/detail/temporary_array.inl index e730966c03..6bfc230993 100644 --- a/thrust/detail/temporary_array.inl +++ b/thrust/detail/temporary_array.inl @@ -20,8 +20,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -162,5 +161,5 @@ __host__ __device__ } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/temporary_buffer.h b/thrust/detail/temporary_buffer.h index 4dca3be3b9..be95e7180f 100644 --- a/thrust/detail/temporary_buffer.h +++ b/thrust/detail/temporary_buffer.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -72,5 +71,5 @@ __host__ __device__ } // end return_temporary_buffer() -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/transform.inl b/thrust/detail/transform.inl index c27e4de27c..3f75744bd9 100644 --- a/thrust/detail/transform.inl +++ b/thrust/detail/transform.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -245,5 +244,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -68,5 +67,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -115,5 +114,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -91,5 +90,5 @@ struct trivial_sequence } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/tuple.inl b/thrust/detail/tuple.inl index 729d84e41a..0015936734 100644 --- a/thrust/detail/tuple.inl +++ b/thrust/detail/tuple.inl @@ -17,8 +17,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // define null_type struct null_type {}; @@ -956,5 +955,5 @@ inline bool operator>=(const detail::cons& lhs, const detail::cons=() -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/tuple_algorithms.h b/thrust/detail/tuple_algorithms.h index 530de4b3f1..2e49f4281f 100644 --- a/thrust/detail/tuple_algorithms.h +++ b/thrust/detail/tuple_algorithms.h @@ -26,8 +26,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template auto tuple_subset(Tuple&& t, index_sequence) @@ -105,7 +104,7 @@ THRUST_DECLTYPE_RETURNS( ) ); -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/detail/tuple_meta_transform.h b/thrust/detail/tuple_meta_transform.h index ebf0b9bf06..58c87542db 100644 --- a/thrust/detail/tuple_meta_transform.h +++ b/thrust/detail/tuple_meta_transform.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -53,5 +52,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -79,5 +78,5 @@ tuple_host_device_transform(const Tuple &t, UnaryFunction f) } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits.h b/thrust/detail/type_traits.h index fc26bc4f2c..58a175ad55 100644 --- a/thrust/detail/type_traits.h +++ b/thrust/detail/type_traits.h @@ -28,8 +28,7 @@ # include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declaration of device_reference template class device_reference; @@ -730,7 +729,7 @@ using detail::integral_constant; using detail::true_type; using detail::false_type; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/type_traits/function_traits.h b/thrust/detail/type_traits/function_traits.h index 0c7775c0dc..3572b25e68 100644 --- a/thrust/detail/type_traits/function_traits.h +++ b/thrust/detail/type_traits/function_traits.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward definitions for is_commutative template struct plus; @@ -92,5 +91,5 @@ template struct is_commutative< typename thrust::bit_and > : template struct is_commutative< typename thrust::bit_xor > : public thrust::detail::is_arithmetic {}; } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits/has_member_function.h b/thrust/detail/type_traits/has_member_function.h index 03ed61b6db..c33fe28f65 100644 --- a/thrust/detail/type_traits/has_member_function.h +++ b/thrust/detail/type_traits/has_member_function.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2013 NVIDIA Corporation + * 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. @@ -18,101 +18,21 @@ #include -#define __THRUST_DEFINE_HAS_MEMBER_FUNCTION(trait_name, member_function_name) \ -template class trait_name; \ - \ -template \ -class trait_name \ -{ \ - class yes { char m; }; \ - class no { yes m[2]; }; \ - struct base_mixin \ - { \ - Result member_function_name(); \ - }; \ - struct base : public T, public base_mixin {}; \ - template class helper{}; \ - template \ - static no deduce(U*, helper* = 0); \ - static yes deduce(...); \ -public: \ - static const bool value = sizeof(yes) == sizeof(deduce(static_cast(0))); \ - typedef thrust::detail::integral_constant type; \ -}; \ - \ -template \ -class trait_name \ -{ \ - class yes { char m; }; \ - class no { yes m[2]; }; \ - struct base_mixin \ - { \ - Result member_function_name(Arg); \ - }; \ - struct base : public T, public base_mixin {}; \ - template class helper{}; \ - template \ - static no deduce(U*, helper* = 0); \ - static yes deduce(...); \ -public: \ - static const bool value = sizeof(yes) == sizeof(deduce(static_cast(0))); \ - typedef thrust::detail::integral_constant type; \ -}; \ - \ -template \ -class trait_name \ -{ \ - class yes { char m; }; \ - class no { yes m[2]; }; \ - struct base_mixin \ - { \ - Result member_function_name(Arg1,Arg2); \ - }; \ - struct base : public T, public base_mixin {}; \ - template class helper{}; \ - template \ - static no deduce(U*, helper* = 0); \ - static yes deduce(...); \ -public: \ - static const bool value = sizeof(yes) == sizeof(deduce(static_cast(0))); \ - typedef thrust::detail::integral_constant type; \ -}; \ - \ -template \ -class trait_name \ -{ \ - class yes { char m; }; \ - class no { yes m[2]; }; \ - struct base_mixin \ - { \ - Result member_function_name(Arg1,Arg2,Arg3); \ - }; \ - struct base : public T, public base_mixin {}; \ - template class helper{}; \ - template \ - static no deduce(U*, helper* = 0); \ - static yes deduce(...); \ -public: \ - static const bool value = sizeof(yes) == sizeof(deduce(static_cast(0))); \ - typedef thrust::detail::integral_constant type; \ -}; \ - \ -template \ -class trait_name \ -{ \ - class yes { char m; }; \ - class no { yes m[2]; }; \ - struct base_mixin \ - { \ - Result member_function_name(Arg1,Arg2,Arg3,Arg4); \ - }; \ - struct base : public T, public base_mixin {}; \ - template class helper{}; \ - template \ - static no deduce(U*, helper* = 0); \ - static yes deduce(...); \ -public: \ - static const bool value = sizeof(yes) == sizeof(deduce(static_cast(0))); \ - typedef thrust::detail::integral_constant type; \ -}; +#include // for std::declval +#define __THRUST_DEFINE_HAS_MEMBER_FUNCTION(trait_name, member_function_name) \ + template \ + struct trait_name : thrust::false_type \ + {}; \ + \ + template \ + struct trait_name::value || \ + thrust::detail::is_convertible< \ + ResultT, \ + decltype(std::declval().member_function_name( \ + std::declval()...))>::value>::type> \ + : thrust::true_type \ + {}; diff --git a/thrust/detail/type_traits/has_trivial_assign.h b/thrust/detail/type_traits/has_trivial_assign.h index 01f26c7ef5..8aa5516511 100644 --- a/thrust/detail/type_traits/has_trivial_assign.h +++ b/thrust/detail/type_traits/has_trivial_assign.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -50,5 +49,5 @@ template struct has_trivial_assign } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits/is_call_possible.h b/thrust/detail/type_traits/is_call_possible.h index bff0493772..b9e7a62ad2 100644 --- a/thrust/detail/type_traits/is_call_possible.h +++ b/thrust/detail/type_traits/is_call_possible.h @@ -22,8 +22,7 @@ // 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 -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace is_call_possible_detail @@ -51,7 +50,7 @@ struct clone_constness } // end is_call_possible_detail } // end detail -} // end thrust +THRUST_NAMESPACE_END #define __THRUST_DEFINE_IS_CALL_POSSIBLE(trait_name, member_function_name) \ __THRUST_DEFINE_HAS_MEMBER_FUNCTION(trait_name##_has_member, member_function_name) \ diff --git a/thrust/detail/type_traits/is_metafunction_defined.h b/thrust/detail/type_traits/is_metafunction_defined.h index c278e5bdb2..754581ae95 100644 --- a/thrust/detail/type_traits/is_metafunction_defined.h +++ b/thrust/detail/type_traits/is_metafunction_defined.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -37,5 +36,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits/iterator/is_discard_iterator.h b/thrust/detail/type_traits/iterator/is_discard_iterator.h index 0a5900de2b..210409d626 100644 --- a/thrust/detail/type_traits/iterator/is_discard_iterator.h +++ b/thrust/detail/type_traits/iterator/is_discard_iterator.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -36,5 +35,5 @@ struct is_discard_iterator< thrust::discard_iterator > {}; } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits/iterator/is_output_iterator.h b/thrust/detail/type_traits/iterator/is_output_iterator.h index d6801305be..555b67400c 100644 --- a/thrust/detail/type_traits/iterator/is_output_iterator.h +++ b/thrust/detail/type_traits/iterator/is_output_iterator.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -62,5 +61,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits/minimum_type.h b/thrust/detail/type_traits/minimum_type.h index 7e34f4f8a5..df14a7fcf8 100644 --- a/thrust/detail/type_traits/minimum_type.h +++ b/thrust/detail/type_traits/minimum_type.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -56,8 +55,8 @@ struct primitive_minimum_type : minimum_type_detail::minimum_type_impl< T1, T2, - ::thrust::detail::is_convertible::value, - ::thrust::detail::is_convertible::value + THRUST_NS_QUALIFIER::detail::is_convertible::value, + THRUST_NS_QUALIFIER::detail::is_convertible::value > { }; // end primitive_minimum_type @@ -158,5 +157,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -392,5 +391,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/type_traits/result_of_adaptable_function.h b/thrust/detail/type_traits/result_of_adaptable_function.h index a849cd0294..908c8abea3 100644 --- a/thrust/detail/type_traits/result_of_adaptable_function.h +++ b/thrust/detail/type_traits/result_of_adaptable_function.h @@ -22,8 +22,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -62,4 +61,4 @@ struct result_of_adaptable_function< }; } // namespace detail -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/uninitialized_copy.inl b/thrust/detail/uninitialized_copy.inl index 660df76d59..d66be923df 100644 --- a/thrust/detail/uninitialized_copy.inl +++ b/thrust/detail/uninitialized_copy.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -92,6 +91,6 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -88,5 +87,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN __thrust_exec_check_disable__ @@ -332,5 +331,5 @@ template -namespace thrust -{ +THRUST_NAMESPACE_BEGIN struct use_default {}; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/util/align.h b/thrust/detail/util/align.h index af97cd44a7..9233b3e0bd 100644 --- a/thrust/detail/util/align.h +++ b/thrust/detail/util/align.h @@ -21,8 +21,7 @@ // functions to handle memory alignment -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { namespace util @@ -55,5 +54,5 @@ bool is_aligned(T * ptr, detail::uintptr_t bytes = sizeof(T)) } // end namespace util } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/detail/vector_base.h b/thrust/detail/vector_base.h index 6b49d38178..b05f35194a 100644 --- a/thrust/detail/vector_base.h +++ b/thrust/detail/vector_base.h @@ -30,8 +30,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -582,7 +581,7 @@ template& lhs, const detail::vector_base& rhs); -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/detail/vector_base.inl b/thrust/detail/vector_base.inl index e5a9b5046b..915f37699b 100644 --- a/thrust/detail/vector_base.inl +++ b/thrust/detail/vector_base.inl @@ -33,8 +33,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -1317,5 +1316,5 @@ bool operator!=(const std::vector& lhs, return !(lhs == rhs); } -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/device_allocator.h b/thrust/device_allocator.h index 8844eb2d38..d61627068a 100644 --- a/thrust/device_allocator.h +++ b/thrust/device_allocator.h @@ -30,8 +30,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /** \addtogroup memory_resources Memory Resources * \ingroup memory_management_classes @@ -140,5 +139,4 @@ class device_allocator /*! \} */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/device_delete.h b/thrust/device_delete.h index ce822f09dc..01d4ad4285 100644 --- a/thrust/device_delete.h +++ b/thrust/device_delete.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup deallocation_functions Deallocation Functions * \ingroup memory_management_functions @@ -50,7 +49,7 @@ template /*! \} */ -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/device_free.h b/thrust/device_free.h index 38d4424c7d..7432772d8d 100644 --- a/thrust/device_free.h +++ b/thrust/device_free.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup deallocation_functions Deallocation Functions * \ingroup memory_management_functions @@ -62,7 +61,7 @@ inline void device_free(thrust::device_ptr ptr); /*! \} */ -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/device_make_unique.h b/thrust/device_make_unique.h index 939006f27e..ca17076034 100644 --- a/thrust/device_make_unique.h +++ b/thrust/device_make_unique.h @@ -32,8 +32,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /////////////////////////////////////////////////////////////////////////////// @@ -54,6 +53,6 @@ auto device_make_unique(Args&&... args) /////////////////////////////////////////////////////////////////////////////// -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/device_malloc.h b/thrust/device_malloc.h index 75194491e5..9b33ac1cce 100644 --- a/thrust/device_malloc.h +++ b/thrust/device_malloc.h @@ -25,8 +25,7 @@ #include #include // for std::size_t -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup allocation_functions Allocation Functions * \ingroup memory_management_functions @@ -97,7 +96,7 @@ template /*! \} */ -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/device_malloc_allocator.h b/thrust/device_malloc_allocator.h index 2af28047ec..b3101c6921 100644 --- a/thrust/device_malloc_allocator.h +++ b/thrust/device_malloc_allocator.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declarations to WAR circular #includes template class device_ptr; @@ -180,6 +179,4 @@ template /*! \} */ -} // end thrust - - +THRUST_NAMESPACE_END diff --git a/thrust/device_new.h b/thrust/device_new.h index 1ae4ce5a40..aa03a603b0 100644 --- a/thrust/device_new.h +++ b/thrust/device_new.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! * \addtogroup allocation_functions Allocation Functions @@ -82,7 +81,6 @@ template /*! \} */ -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/device_new_allocator.h b/thrust/device_new_allocator.h index 28eeabd1df..972cab32a3 100644 --- a/thrust/device_new_allocator.h +++ b/thrust/device_new_allocator.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup memory_management_classes Memory Management Classes * \ingroup memory_management @@ -168,5 +167,4 @@ template /*! \} */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/device_ptr.h b/thrust/device_ptr.h index f9149da148..9179197251 100644 --- a/thrust/device_ptr.h +++ b/thrust/device_ptr.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup memory_management Memory Management * \addtogroup memory_management_classes Memory Management Classes @@ -185,8 +184,7 @@ inline device_ptr device_pointer_cast(const device_ptr &ptr); /*! \} */ -} // end thrust +THRUST_NAMESPACE_END #include #include - diff --git a/thrust/device_reference.h b/thrust/device_reference.h index 6cd98292c1..5eff9f2182 100644 --- a/thrust/device_reference.h +++ b/thrust/device_reference.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup memory_management_classes Memory Management Classes * \ingroup memory_management @@ -986,5 +985,4 @@ operator<<(std::basic_ostream &os, const device_reference &y); /*! \} */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/device_vector.h b/thrust/device_vector.h index b46fa2f2dc..b8e6bb65b0 100644 --- a/thrust/device_vector.h +++ b/thrust/device_vector.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup container_classes Container Classes * \addtogroup device_containers Device Containers @@ -489,6 +488,4 @@ template /*! \} */ -} // namespace thrust - - +THRUST_NAMESPACE_END diff --git a/thrust/distance.h b/thrust/distance.h index ba0c53b3c3..8908791151 100644 --- a/thrust/distance.h +++ b/thrust/distance.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -71,7 +69,6 @@ inline __host__ __device__ /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/equal.h b/thrust/equal.h index 73baaf2e70..2f35189078 100644 --- a/thrust/equal.h +++ b/thrust/equal.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reductions * \{ @@ -232,7 +230,6 @@ bool equal(InputIterator1 first1, InputIterator1 last1, * \} // end reductions */ -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/execution_policy.h b/thrust/execution_policy.h index 60a4caba0f..1e5dfa8f74 100644 --- a/thrust/execution_policy.h +++ b/thrust/execution_policy.h @@ -39,9 +39,7 @@ //! \endcond -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \cond */ @@ -392,5 +390,4 @@ static const detail::seq_t seq; */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/extrema.h b/thrust/extrema.h index 080cb84724..ca419a0aa5 100644 --- a/thrust/extrema.h +++ b/thrust/extrema.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! This version of \p min returns the smaller of two values, given a comparison operation. * \param lhs The first value to compare. @@ -797,8 +795,7 @@ thrust::pair minmax_element(ForwardIterator fir * \} // end reductions */ -} // end thrust +THRUST_NAMESPACE_END #include #include - diff --git a/thrust/fill.h b/thrust/fill.h index 1431b82f9e..bd9e402689 100644 --- a/thrust/fill.h +++ b/thrust/fill.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup transformations * \addtogroup filling @@ -203,7 +201,6 @@ __host__ __device__ * \} // transformations */ -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/find.h b/thrust/find.h index 0e4aaafe1e..5ab9b0a2df 100644 --- a/thrust/find.h +++ b/thrust/find.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -378,8 +376,6 @@ InputIterator find_if_not(InputIterator first, /*! \} // end searching */ - -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/for_each.h b/thrust/for_each.h index e750e29233..db569d4441 100644 --- a/thrust/for_each.h +++ b/thrust/for_each.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup modifying * \ingroup transformations @@ -274,7 +272,7 @@ InputIterator for_each_n(InputIterator first, /*! \} // end modifying */ -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/functional.h b/thrust/functional.h index 741f639343..fed0c17e12 100644 --- a/thrust/functional.h +++ b/thrust/functional.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup function_objects Function Objects */ @@ -1712,8 +1711,7 @@ THRUST_INLINE_CONSTANT thrust::detail::functional::placeholder<9>::type _10; #undef THRUST_BINARY_FUNCTOR_VOID_SPECIALIZATION #undef THRUST_BINARY_FUNCTOR_VOID_SPECIALIZATION_OP -} // end thrust +THRUST_NAMESPACE_END #include #include - diff --git a/thrust/future.h b/thrust/future.h index 25a231fbe6..d8fb7544b1 100644 --- a/thrust/future.h +++ b/thrust/future.h @@ -54,8 +54,7 @@ #include __THRUST_DEVICE_SYSTEM_FUTURE_HEADER #undef __THRUST_DEVICE_SYSTEM_FUTURE_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /////////////////////////////////////////////////////////////////////////////// @@ -172,7 +171,6 @@ using thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::when_all; /////////////////////////////////////////////////////////////////////////////// -} // end namespace thrust +THRUST_NAMESPACE_END #endif - diff --git a/thrust/gather.h b/thrust/gather.h index 90cfad746f..41acc22a34 100644 --- a/thrust/gather.h +++ b/thrust/gather.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup gathering * \ingroup copying @@ -441,7 +439,7 @@ template diff --git a/thrust/generate.h b/thrust/generate.h index 8bdb5791d0..d472953446 100644 --- a/thrust/generate.h +++ b/thrust/generate.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup transformations * \{ @@ -207,7 +205,7 @@ template diff --git a/thrust/host_vector.h b/thrust/host_vector.h index 5f9c6d9294..2a4d9f22f8 100644 --- a/thrust/host_vector.h +++ b/thrust/host_vector.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup container_classes Container Classes * \addtogroup host_containers Host Containers @@ -508,5 +507,4 @@ template /*! \} */ -} // namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/inner_product.h b/thrust/inner_product.h index dd20c196ce..80068cf0c8 100644 --- a/thrust/inner_product.h +++ b/thrust/inner_product.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reductions * \{ @@ -258,7 +256,7 @@ OutputType inner_product(InputIterator1 first1, InputIterator1 last1, * \} // end reductions */ -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/iterator/constant_iterator.h b/thrust/iterator/constant_iterator.h index 802d8b34bd..c6eec28e70 100644 --- a/thrust/iterator/constant_iterator.h +++ b/thrust/iterator/constant_iterator.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -247,5 +246,5 @@ constant_iterator make_constant_iterator(V x) /*! \} // end iterators */ -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/counting_iterator.h b/thrust/iterator/counting_iterator.h index 25d495db05..a7ef2ec7cd 100644 --- a/thrust/iterator/counting_iterator.h +++ b/thrust/iterator/counting_iterator.h @@ -39,8 +39,7 @@ // #include the details first #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -243,5 +242,5 @@ counting_iterator make_counting_iterator(Incrementable x) /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/any_assign.h b/thrust/iterator/detail/any_assign.h index 4e7f2cf20b..87192215c3 100644 --- a/thrust/iterator/detail/any_assign.h +++ b/thrust/iterator/detail/any_assign.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -51,5 +50,5 @@ struct any_assign } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/any_system_tag.h b/thrust/iterator/detail/any_system_tag.h index 27640b5e0d..2c5ce6448b 100644 --- a/thrust/iterator/detail/any_system_tag.h +++ b/thrust/iterator/detail/any_system_tag.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN struct any_system_tag : thrust::execution_policy @@ -30,5 +29,5 @@ struct any_system_tag template operator T () const {return T();} }; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/constant_iterator_base.h b/thrust/iterator/detail/constant_iterator_base.h index 56b1cc4f4c..aa555199ec 100644 --- a/thrust/iterator/detail/constant_iterator_base.h +++ b/thrust/iterator/detail/constant_iterator_base.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declaration of constant_iterator template class constant_iterator; @@ -66,5 +65,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declaration of counting_iterator template @@ -137,5 +136,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/device_system_tag.h b/thrust/iterator/detail/device_system_tag.h index df20389e9f..b86109d216 100644 --- a/thrust/iterator/detail/device_system_tag.h +++ b/thrust/iterator/detail/device_system_tag.h @@ -23,9 +23,8 @@ #include __THRUST_DEVICE_SYSTEM_TAG_HEADER #undef __THRUST_DEVICE_SYSTEM_TAG_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN typedef thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::tag device_system_tag; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/discard_iterator_base.h b/thrust/iterator/detail/discard_iterator_base.h index a4a8c312b1..38f77b3781 100644 --- a/thrust/iterator/detail/discard_iterator_base.h +++ b/thrust/iterator/detail/discard_iterator_base.h @@ -22,8 +22,7 @@ #include #include // for std::ptrdiff_t -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declaration of discard_iterator template class discard_iterator; @@ -60,6 +59,6 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/distance_from_result.h b/thrust/iterator/detail/distance_from_result.h index 2b7e0d60e5..fe140344d4 100644 --- a/thrust/iterator/detail/distance_from_result.h +++ b/thrust/iterator/detail/distance_from_result.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -38,5 +37,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/host_system_tag.h b/thrust/iterator/detail/host_system_tag.h index 379882f2b8..58478f8d92 100644 --- a/thrust/iterator/detail/host_system_tag.h +++ b/thrust/iterator/detail/host_system_tag.h @@ -23,9 +23,8 @@ #include __THRUST_HOST_SYSTEM_TAG_HEADER #undef __THRUST_HOST_SYSTEM_TAG_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN typedef thrust::system::__THRUST_HOST_SYSTEM_NAMESPACE::tag host_system_tag; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/is_iterator_category.h b/thrust/iterator/detail/is_iterator_category.h index b538358be3..e520452a3c 100644 --- a/thrust/iterator/detail/is_iterator_category.h +++ b/thrust/iterator/detail/is_iterator_category.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -56,5 +55,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/iterator_adaptor_base.h b/thrust/iterator/detail/iterator_adaptor_base.h index d9dbfaae6b..8b04b79a90 100644 --- a/thrust/iterator/detail/iterator_adaptor_base.h +++ b/thrust/iterator/detail/iterator_adaptor_base.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declaration of iterator_adaptor for iterator_adaptor_base below @@ -107,5 +106,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -76,5 +75,5 @@ template }; // end iterator_category_or_traversal_to_system } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/iterator_category_to_traversal.h b/thrust/iterator/detail/iterator_category_to_traversal.h index 7596682e2e..46db4410bb 100644 --- a/thrust/iterator/detail/iterator_category_to_traversal.h +++ b/thrust/iterator/detail/iterator_category_to_traversal.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -127,5 +126,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/iterator_category_with_system_and_traversal.h b/thrust/iterator/detail/iterator_category_with_system_and_traversal.h index 8f5374b165..cdd8a6d366 100644 --- a/thrust/iterator/detail/iterator_category_with_system_and_traversal.h +++ b/thrust/iterator/detail/iterator_category_with_system_and_traversal.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -53,5 +52,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/iterator_facade_category.h b/thrust/iterator/detail/iterator_facade_category.h index e00d3ef054..81b518002b 100644 --- a/thrust/iterator/detail/iterator_facade_category.h +++ b/thrust/iterator/detail/iterator_facade_category.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -249,5 +248,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template struct iterator_value @@ -134,5 +133,5 @@ template } // end namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/iterator_traversal_tags.h b/thrust/iterator/detail/iterator_traversal_tags.h index 73cd1f76af..b999d7901d 100644 --- a/thrust/iterator/detail/iterator_traversal_tags.h +++ b/thrust/iterator/detail/iterator_traversal_tags.h @@ -16,8 +16,7 @@ #pragma once -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // define Boost's traversal tags struct no_traversal_tag {}; @@ -37,5 +36,5 @@ struct bidirectional_traversal_tag struct random_access_traversal_tag : bidirectional_traversal_tag {}; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/join_iterator.h b/thrust/iterator/detail/join_iterator.h index 1ab99ce47f..83f143dc00 100644 --- a/thrust/iterator/detail/join_iterator.h +++ b/thrust/iterator/detail/join_iterator.h @@ -23,8 +23,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -130,5 +129,5 @@ join_iterator make_join_iterat } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/minimum_category.h b/thrust/iterator/detail/minimum_category.h index abb80d8c10..f7d0bb4d7a 100644 --- a/thrust/iterator/detail/minimum_category.h +++ b/thrust/iterator/detail/minimum_category.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -47,6 +46,6 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -78,5 +77,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -74,5 +73,5 @@ struct proclaim_contiguous_iterator< thrust::detail::normal_iterator > : true_type {}; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/permutation_iterator_base.h b/thrust/iterator/detail/permutation_iterator_base.h index 2610cfdfaf..158dc7a2d3 100644 --- a/thrust/iterator/detail/permutation_iterator_base.h +++ b/thrust/iterator/detail/permutation_iterator_base.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class permutation_iterator; @@ -49,5 +48,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -144,5 +143,5 @@ __host__ __device__ } // end retag() -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/reverse_iterator.inl b/thrust/iterator/detail/reverse_iterator.inl index bb96c497fc..c4bf9c2764 100644 --- a/thrust/iterator/detail/reverse_iterator.inl +++ b/thrust/iterator/detail/reverse_iterator.inl @@ -17,8 +17,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -111,5 +110,5 @@ reverse_iterator make_reverse_iterator(BidirectionalItera } // end make_reverse_iterator() -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/reverse_iterator_base.h b/thrust/iterator/detail/reverse_iterator_base.h index 68fa1f2f81..5ae844c2b2 100644 --- a/thrust/iterator/detail/reverse_iterator_base.h +++ b/thrust/iterator/detail/reverse_iterator_base.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class reverse_iterator; @@ -38,5 +37,5 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/tagged_iterator.h b/thrust/iterator/detail/tagged_iterator.h index 125a4675e8..4ac0306444 100644 --- a/thrust/iterator/detail/tagged_iterator.h +++ b/thrust/iterator/detail/tagged_iterator.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -67,5 +66,5 @@ struct proclaim_contiguous_iterator< detail::tagged_iterator > : is_contiguous_iterator {}; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/transform_input_output_iterator.inl b/thrust/iterator/detail/transform_input_output_iterator.inl index b3c9e1bc51..aba4e487a2 100644 --- a/thrust/iterator/detail/transform_input_output_iterator.inl +++ b/thrust/iterator/detail/transform_input_output_iterator.inl @@ -16,8 +16,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class transform_input_output_iterator; @@ -110,5 +109,5 @@ struct is_proxy_reference< : public thrust::detail::true_type {}; } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/transform_iterator.inl b/thrust/iterator/detail/transform_iterator.inl index 65eee86873..96cebe7636 100644 --- a/thrust/iterator/detail/transform_iterator.inl +++ b/thrust/iterator/detail/transform_iterator.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class transform_iterator; @@ -68,5 +67,5 @@ struct transform_iterator_base } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/transform_output_iterator.inl b/thrust/iterator/detail/transform_output_iterator.inl index 91f657ca72..f683d2832d 100644 --- a/thrust/iterator/detail/transform_output_iterator.inl +++ b/thrust/iterator/detail/transform_output_iterator.inl @@ -17,8 +17,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template class transform_output_iterator; @@ -74,5 +73,5 @@ struct is_proxy_reference< : public thrust::detail::true_type {}; } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/tuple_of_iterator_references.h b/thrust/iterator/detail/tuple_of_iterator_references.h index 7ec59f390c..78c5e8a28f 100644 --- a/thrust/iterator/detail/tuple_of_iterator_references.h +++ b/thrust/iterator/detail/tuple_of_iterator_references.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -143,5 +142,5 @@ struct tuple_element> }; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/universal_categories.h b/thrust/iterator/detail/universal_categories.h index 2389796b19..d2abd7f55b 100644 --- a/thrust/iterator/detail/universal_categories.h +++ b/thrust/iterator/detail/universal_categories.h @@ -21,8 +21,7 @@ // XXX eliminate this file -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // define these types without inheritance to avoid ambiguous conversion to base classes @@ -83,5 +82,5 @@ struct random_access_universal_iterator_tag }; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/zip_iterator.inl b/thrust/iterator/detail/zip_iterator.inl index d1ead2c42b..399440f671 100644 --- a/thrust/iterator/detail/zip_iterator.inl +++ b/thrust/iterator/detail/zip_iterator.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template @@ -147,5 +146,5 @@ __host__ __device__ } // end make_zip_iterator() -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/detail/zip_iterator_base.h b/thrust/iterator/detail/zip_iterator_base.h index eddae23ae1..dcaa737c73 100644 --- a/thrust/iterator/detail/zip_iterator_base.h +++ b/thrust/iterator/detail/zip_iterator_base.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declare zip_iterator for zip_iterator_base template class zip_iterator; @@ -347,6 +346,6 @@ template } // end detail -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/discard_iterator.h b/thrust/iterator/discard_iterator.h index c1613694d8..eb5156edac 100644 --- a/thrust/iterator/discard_iterator.h +++ b/thrust/iterator/discard_iterator.h @@ -27,8 +27,7 @@ THRUST_DISABLE_MSVC_POSSIBLE_LOSS_OF_DATA_WARNING_BEGIN -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -169,7 +168,7 @@ discard_iterator<> make_discard_iterator(discard_iterator<>::difference_type i = /*! \} // end iterators */ -} // end namespace thrust +THRUST_NAMESPACE_END THRUST_DISABLE_MSVC_POSSIBLE_LOSS_OF_DATA_WARNING_END diff --git a/thrust/iterator/iterator_adaptor.h b/thrust/iterator/iterator_adaptor.h index f9f06a89a3..67d4866b9a 100644 --- a/thrust/iterator/iterator_adaptor.h +++ b/thrust/iterator/iterator_adaptor.h @@ -37,8 +37,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -239,5 +238,5 @@ template -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \addtogroup iterator_tags Iterator Tags @@ -218,7 +217,7 @@ typedef std::random_access_iterator_tag random_access_host_iterator_tag; /*! \} // end iterator_tag_classes */ -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/iterator/iterator_facade.h b/thrust/iterator/iterator_facade.h index 86757d7122..f6920c5c85 100644 --- a/thrust/iterator/iterator_facade.h +++ b/thrust/iterator/iterator_facade.h @@ -37,8 +37,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -539,5 +538,5 @@ Derived operator+ (typename Derived::difference_type n, /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/iterator_traits.h b/thrust/iterator/iterator_traits.h index 5a33658c22..93df41291f 100644 --- a/thrust/iterator/iterator_traits.h +++ b/thrust/iterator/iterator_traits.h @@ -35,8 +35,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -104,7 +103,7 @@ template struct iterator_traversal; template struct iterator_system; -} // namespace thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/iterator/permutation_iterator.h b/thrust/iterator/permutation_iterator.h index 73827040ab..2a07499c52 100644 --- a/thrust/iterator/permutation_iterator.h +++ b/thrust/iterator/permutation_iterator.h @@ -37,8 +37,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators @@ -213,5 +212,5 @@ permutation_iterator make_permutation_iterator(El /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/retag.h b/thrust/iterator/retag.h index 6adf5e2444..1eb770ae32 100644 --- a/thrust/iterator/retag.h +++ b/thrust/iterator/retag.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \ingroup iterator_tags @@ -66,5 +65,5 @@ unspecified_iterator_type retag(Iterator iter); */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/reverse_iterator.h b/thrust/iterator/reverse_iterator.h index 365bc34d2e..fe8bbe0cf8 100644 --- a/thrust/iterator/reverse_iterator.h +++ b/thrust/iterator/reverse_iterator.h @@ -37,8 +37,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -232,7 +231,7 @@ reverse_iterator make_reverse_iterator(BidirectionalItera /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/iterator/transform_input_output_iterator.h b/thrust/iterator/transform_input_output_iterator.h index 25c10eb58e..f512a36cb5 100644 --- a/thrust/iterator/transform_input_output_iterator.h +++ b/thrust/iterator/transform_input_output_iterator.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -159,5 +158,5 @@ make_transform_input_output_iterator(Iterator io, InputFunction input_function, /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/transform_iterator.h b/thrust/iterator/transform_iterator.h index 5520b2a1fe..5afb5f37b0 100644 --- a/thrust/iterator/transform_iterator.h +++ b/thrust/iterator/transform_iterator.h @@ -40,8 +40,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -352,5 +351,5 @@ make_transform_iterator(Iterator it, AdaptableUnaryFunction fun) /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/transform_output_iterator.h b/thrust/iterator/transform_output_iterator.h index 4c6683ae5c..66fb46a376 100644 --- a/thrust/iterator/transform_output_iterator.h +++ b/thrust/iterator/transform_output_iterator.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -159,5 +158,5 @@ make_transform_output_iterator(OutputIterator out, UnaryFunction fun) /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/iterator/zip_iterator.h b/thrust/iterator/zip_iterator.h index 14f7e873ac..c2dd5ddc45 100644 --- a/thrust/iterator/zip_iterator.h +++ b/thrust/iterator/zip_iterator.h @@ -36,8 +36,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup iterators * \{ @@ -253,7 +252,7 @@ zip_iterator> make_zip_iterator(Iterators... its); /*! \} // end iterators */ -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/limits.h b/thrust/limits.h index f83dde9c37..57aee100cb 100644 --- a/thrust/limits.h +++ b/thrust/limits.h @@ -9,11 +9,9 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template struct numeric_limits : std::numeric_limits {}; -} // end namespace thrust - +THRUST_NAMESPACE_END diff --git a/thrust/logical.h b/thrust/logical.h index 7ad30b8d25..5a8dbbecf6 100644 --- a/thrust/logical.h +++ b/thrust/logical.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reductions * \{ @@ -272,8 +270,6 @@ bool none_of(InputIterator first, InputIterator last, Predicate pred); * \} // end reductions */ - -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/memory.h b/thrust/memory.h index 9ef8833f57..bb57d9bd07 100644 --- a/thrust/memory.h +++ b/thrust/memory.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \defgroup memory_management Memory Management * @@ -543,5 +542,4 @@ typename detail::raw_reference::type /*! \} */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/merge.h b/thrust/merge.h index 3c0d349e47..724f4c167f 100644 --- a/thrust/merge.h +++ b/thrust/merge.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup merging Merging * \ingroup algorithms @@ -674,7 +672,6 @@ template - diff --git a/thrust/mismatch.h b/thrust/mismatch.h index 8dbe9a0d59..bbdf2923a0 100644 --- a/thrust/mismatch.h +++ b/thrust/mismatch.h @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -254,7 +252,6 @@ thrust::pair mismatch(InputIterator1 first1, /*! \} // end searching */ -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/mr/allocator.h b/thrust/mr/allocator.h index 148d77e651..77dfa8deb5 100644 --- a/thrust/mr/allocator.h +++ b/thrust/mr/allocator.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -246,5 +245,5 @@ class stateless_resource_allocator : public thrust::mr::allocator }; } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/device_memory_resource.h b/thrust/mr/device_memory_resource.h index 2230843094..3a671142aa 100644 --- a/thrust/mr/device_memory_resource.h +++ b/thrust/mr/device_memory_resource.h @@ -23,8 +23,7 @@ #include __THRUST_DEVICE_SYSTEM_MEMORY_HEADER #undef __THRUST_DEVICE_SYSTEM_MEMORY_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN typedef thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::memory_resource @@ -35,5 +34,5 @@ typedef thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::universal_host_pinned_ universal_host_pinned_memory_resource; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/disjoint_pool.h b/thrust/mr/disjoint_pool.h index 32a59f4bcf..3426831999 100644 --- a/thrust/mr/disjoint_pool.h +++ b/thrust/mr/disjoint_pool.h @@ -33,8 +33,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -485,5 +484,5 @@ class disjoint_unsynchronized_pool_resource final */ } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/disjoint_sync_pool.h b/thrust/mr/disjoint_sync_pool.h index a97b935bd1..46ea31ffbf 100644 --- a/thrust/mr/disjoint_sync_pool.h +++ b/thrust/mr/disjoint_sync_pool.h @@ -28,8 +28,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -113,7 +112,7 @@ struct disjoint_synchronized_pool_resource : public memory_resource= 2011 diff --git a/thrust/mr/disjoint_tls_pool.h b/thrust/mr/disjoint_tls_pool.h index e50eba7625..bf49598671 100644 --- a/thrust/mr/disjoint_tls_pool.h +++ b/thrust/mr/disjoint_tls_pool.h @@ -26,8 +26,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -63,7 +62,7 @@ thrust::mr::disjoint_unsynchronized_pool_resource & tls_di */ } // end mr -} // end thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/mr/fancy_pointer_resource.h b/thrust/mr/fancy_pointer_resource.h index e6e0bd2404..7427cee4d0 100644 --- a/thrust/mr/fancy_pointer_resource.h +++ b/thrust/mr/fancy_pointer_resource.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -57,5 +56,5 @@ class fancy_pointer_resource final : public memory_resource, private va }; } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/host_memory_resource.h b/thrust/mr/host_memory_resource.h index 755c1b3197..9359a97a7d 100644 --- a/thrust/mr/host_memory_resource.h +++ b/thrust/mr/host_memory_resource.h @@ -23,11 +23,10 @@ #include __THRUST_HOST_SYSTEM_MEMORY_HEADER #undef __THRUST_HOST_SYSTEM_MEMORY_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN typedef thrust::system::__THRUST_HOST_SYSTEM_NAMESPACE::memory_resource host_memory_resource; -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/memory_resource.h b/thrust/mr/memory_resource.h index 573d5eeb8f..6b52afbbbf 100644 --- a/thrust/mr/memory_resource.h +++ b/thrust/mr/memory_resource.h @@ -26,8 +26,7 @@ # include THRUST_MR_STD_MR_HEADER #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \brief \p thrust::mr is the namespace containing system agnostic types and functions for \p memory_resource related functionalities. */ namespace mr @@ -213,5 +212,5 @@ MR * get_global_resource() */ } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/new.h b/thrust/mr/new.h index 996432485d..b0176216f2 100644 --- a/thrust/mr/new.h +++ b/thrust/mr/new.h @@ -22,8 +22,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -84,5 +83,5 @@ class new_delete_resource final : public memory_resource<> */ } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/polymorphic_adaptor.h b/thrust/mr/polymorphic_adaptor.h index 5a3cdedd37..1894444aaf 100644 --- a/thrust/mr/polymorphic_adaptor.h +++ b/thrust/mr/polymorphic_adaptor.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -52,5 +51,5 @@ class polymorphic_adaptor_resource final : public memory_resource }; } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/pool.h b/thrust/mr/pool.h index 8886688aa5..4445a36ee9 100644 --- a/thrust/mr/pool.h +++ b/thrust/mr/pool.h @@ -31,8 +31,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -501,5 +500,5 @@ class unsynchronized_pool_resource final */ } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/pool_options.h b/thrust/mr/pool_options.h index 7994e914ab..67e709ce69 100644 --- a/thrust/mr/pool_options.h +++ b/thrust/mr/pool_options.h @@ -26,8 +26,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -123,5 +122,5 @@ struct pool_options */ } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/mr/sync_pool.h b/thrust/mr/sync_pool.h index 1ecb10b0a3..92148f3c03 100644 --- a/thrust/mr/sync_pool.h +++ b/thrust/mr/sync_pool.h @@ -28,8 +28,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -110,7 +109,7 @@ struct synchronized_pool_resource : public memory_resource= 2011 diff --git a/thrust/mr/tls_pool.h b/thrust/mr/tls_pool.h index c732f022f7..b718d00c78 100644 --- a/thrust/mr/tls_pool.h +++ b/thrust/mr/tls_pool.h @@ -26,8 +26,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -58,7 +57,7 @@ thrust::mr::unsynchronized_pool_resource & tls_pool(Upstream * upstrea */ } // end mr -} // end thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/mr/validator.h b/thrust/mr/validator.h index 8f8676d11f..108583dbaf 100644 --- a/thrust/mr/validator.h +++ b/thrust/mr/validator.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace mr { @@ -46,5 +45,5 @@ struct validator2 : private validator }; } // end mr -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/optional.h b/thrust/optional.h index e8dc91b7f8..9b0c6ef012 100644 --- a/thrust/optional.h +++ b/thrust/optional.h @@ -1,6 +1,6 @@ /// // optional - An implementation of std::optional with extensions -// Written in 2017 by Simon Brand (@TartanLlama) +// Written in 2017 by Sy Brand (@TartanLlama) // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to the @@ -73,8 +73,7 @@ !defined(__clang__)) #ifndef THRUST_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX #define THRUST_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { template struct is_trivially_copy_constructible : std::is_trivially_copy_constructible{}; @@ -84,7 +83,7 @@ namespace thrust : std::is_trivially_copy_constructible{}; #endif } -} // end namespace thrust +THRUST_NAMESPACE_END #endif #define THRUST_OPTIONAL_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ @@ -163,8 +162,8 @@ namespace thrust #define THRUST_OPTIONAL_CPP11_CONSTEXPR constexpr #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN + #ifndef THRUST_MONOSTATE_INPLACE_MUTEX #define THRUST_MONOSTATE_INPLACE_MUTEX /// \brief Used to represent an optional with no data; essentially a bool @@ -2866,18 +2865,18 @@ template class optional { T *m_value; }; -} // end namespace thrust +THRUST_NAMESPACE_END namespace std { // TODO SFINAE -template struct hash> { +template struct hash> { __thrust_exec_check_disable__ __host__ __device__ - ::std::size_t operator()(const thrust::optional &o) const { + ::std::size_t operator()(const THRUST_NS_QUALIFIER::optional &o) const { if (!o.has_value()) return 0; - return std::hash>()(*o); + return std::hash>()(*o); } }; } // namespace std diff --git a/thrust/pair.h b/thrust/pair.h index d3c30daf81..eb2138aaf2 100644 --- a/thrust/pair.h +++ b/thrust/pair.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup utility * \{ @@ -277,7 +276,6 @@ template struct tuple_size; /*! \} // utility */ -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/partition.h b/thrust/partition.h index d3f0db83f4..90768f2467 100644 --- a/thrust/partition.h +++ b/thrust/partition.h @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reordering * \ingroup algorithms @@ -1432,8 +1430,7 @@ template * \} // end reductions */ - -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/per_device_resource.h b/thrust/per_device_resource.h index 3c0158aeea..12e0409f66 100644 --- a/thrust/per_device_resource.h +++ b/thrust/per_device_resource.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! Returns a global instance of \p MR for the current device of the provided system. * @@ -98,7 +97,6 @@ class per_device_allocator : public thrust::mr::allocator ~per_device_allocator() {} }; - -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/random.h b/thrust/random.h index c0e9e22824..7463620b7b 100644 --- a/thrust/random.h +++ b/thrust/random.h @@ -35,9 +35,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup random Random Number Generation * \{ @@ -116,5 +114,4 @@ using random::ranlux48; using random::taus88; using random::default_random_engine; -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/discard_block_engine.inl b/thrust/random/detail/discard_block_engine.inl index fca16c2bfd..725a94a70f 100644 --- a/thrust/random/detail/discard_block_engine.inl +++ b/thrust/random/detail/discard_block_engine.inl @@ -16,8 +16,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -208,5 +207,5 @@ bool operator!=(const discard_block_engine &lhs, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/linear_congruential_engine.inl b/thrust/random/detail/linear_congruential_engine.inl index da0b03e15c..e6106bb851 100644 --- a/thrust/random/detail/linear_congruential_engine.inl +++ b/thrust/random/detail/linear_congruential_engine.inl @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -165,5 +164,5 @@ operator>>(std::basic_istream &is, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/linear_congruential_engine_discard.h b/thrust/random/detail/linear_congruential_engine_discard.h index 3815951440..4fe3061f72 100644 --- a/thrust/random/detail/linear_congruential_engine_discard.h +++ b/thrust/random/detail/linear_congruential_engine_discard.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -103,5 +102,5 @@ struct linear_congruential_engine_discard } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/linear_feedback_shift_engine.inl b/thrust/random/detail/linear_feedback_shift_engine.inl index b5d55be152..49ab399c59 100644 --- a/thrust/random/detail/linear_feedback_shift_engine.inl +++ b/thrust/random/detail/linear_feedback_shift_engine.inl @@ -16,8 +16,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -161,5 +160,5 @@ operator>>(std::basic_istream &is, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/linear_feedback_shift_engine_wordmask.h b/thrust/random/detail/linear_feedback_shift_engine_wordmask.h index 6669350eae..d299f9d079 100644 --- a/thrust/random/detail/linear_feedback_shift_engine_wordmask.h +++ b/thrust/random/detail/linear_feedback_shift_engine_wordmask.h @@ -16,8 +16,7 @@ #pragma once -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -43,5 +42,5 @@ template } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/mod.h b/thrust/random/detail/mod.h index 62f2d56d59..f0637582de 100644 --- a/thrust/random/detail/mod.h +++ b/thrust/random/detail/mod.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -95,5 +94,5 @@ __host__ __device__ } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/normal_distribution.inl b/thrust/random/detail/normal_distribution.inl index 099a977f33..3bd960268e 100644 --- a/thrust/random/detail/normal_distribution.inl +++ b/thrust/random/detail/normal_distribution.inl @@ -27,8 +27,7 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -251,5 +250,5 @@ operator>>(std::basic_istream &is, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/normal_distribution_base.h b/thrust/random/detail/normal_distribution_base.h index 94b9663519..f67cb7152b 100644 --- a/thrust/random/detail/normal_distribution_base.h +++ b/thrust/random/detail/normal_distribution_base.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { namespace detail @@ -145,5 +144,5 @@ template } // end detail } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/random_core_access.h b/thrust/random/detail/random_core_access.h index f03060e0ab..6c94a79f17 100644 --- a/thrust/random/detail/random_core_access.h +++ b/thrust/random/detail/random_core_access.h @@ -16,8 +16,7 @@ #pragma once -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -53,5 +52,5 @@ static bool equal(const EngineOrDistribution &lhs, const EngineOrDistribution &r } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/subtract_with_carry_engine.inl b/thrust/random/detail/subtract_with_carry_engine.inl index cb73835887..9ff04eb23e 100644 --- a/thrust/random/detail/subtract_with_carry_engine.inl +++ b/thrust/random/detail/subtract_with_carry_engine.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -206,5 +205,5 @@ template } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/uniform_int_distribution.inl b/thrust/random/detail/uniform_int_distribution.inl index 18eb5194cc..c63fcd8464 100644 --- a/thrust/random/detail/uniform_int_distribution.inl +++ b/thrust/random/detail/uniform_int_distribution.inl @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -242,5 +241,5 @@ operator>>(std::basic_istream &is, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/uniform_real_distribution.inl b/thrust/random/detail/uniform_real_distribution.inl index ec4f21e9e4..72abdbc660 100644 --- a/thrust/random/detail/uniform_real_distribution.inl +++ b/thrust/random/detail/uniform_real_distribution.inl @@ -16,8 +16,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -227,5 +226,5 @@ operator>>(std::basic_istream &is, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/xor_combine_engine.inl b/thrust/random/detail/xor_combine_engine.inl index d24865f68f..dfbd8364c4 100644 --- a/thrust/random/detail/xor_combine_engine.inl +++ b/thrust/random/detail/xor_combine_engine.inl @@ -17,8 +17,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -211,5 +210,5 @@ bool operator!=(const xor_combine_engine &lhs, } // end random -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/random/detail/xor_combine_engine_max.h b/thrust/random/detail/xor_combine_engine_max.h index cfb5bdc831..9846ff956c 100644 --- a/thrust/random/detail/xor_combine_engine_max.h +++ b/thrust/random/detail/xor_combine_engine_max.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -320,5 +319,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -246,7 +245,7 @@ operator>>(std::basic_istream &is, // import names into thrust:: using random::discard_block_engine; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/linear_congruential_engine.h b/thrust/random/linear_congruential_engine.h index 0dc72b3b13..dac03d90eb 100644 --- a/thrust/random/linear_congruential_engine.h +++ b/thrust/random/linear_congruential_engine.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -289,7 +288,7 @@ using random::linear_congruential_engine; using random::minstd_rand; using random::minstd_rand0; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/linear_feedback_shift_engine.h b/thrust/random/linear_feedback_shift_engine.h index 90c572c9ba..a46c6d8ab8 100644 --- a/thrust/random/linear_feedback_shift_engine.h +++ b/thrust/random/linear_feedback_shift_engine.h @@ -35,8 +35,7 @@ #include // for size_t #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random @@ -224,7 +223,7 @@ operator>>(std::basic_istream &is, // import names into thrust:: using random::linear_feedback_shift_engine; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/normal_distribution.h b/thrust/random/normal_distribution.h index ac45e161a0..36b985cb68 100644 --- a/thrust/random/normal_distribution.h +++ b/thrust/random/normal_distribution.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -269,7 +268,7 @@ operator>>(std::basic_istream &is, using random::normal_distribution; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/subtract_with_carry_engine.h b/thrust/random/subtract_with_carry_engine.h index 0b12ca3530..69ee841fda 100644 --- a/thrust/random/subtract_with_carry_engine.h +++ b/thrust/random/subtract_with_carry_engine.h @@ -28,8 +28,7 @@ #include // for size_t #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -250,7 +249,7 @@ using random::subtract_with_carry_engine; using random::ranlux24_base; using random::ranlux48_base; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/uniform_int_distribution.h b/thrust/random/uniform_int_distribution.h index 42d7457819..18f369fc2a 100644 --- a/thrust/random/uniform_int_distribution.h +++ b/thrust/random/uniform_int_distribution.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -110,7 +109,8 @@ template * the platform. */ __host__ __device__ - explicit uniform_int_distribution(IntType a = 0, IntType b = thrust::detail::integer_traits::const_max); + explicit uniform_int_distribution(IntType a = 0, + IntType b = THRUST_NS_QUALIFIER::detail::integer_traits::const_max); /*! This constructor creates a new \p uniform_int_distribution from a \p param_type object * encapsulating the range of the distribution. @@ -270,7 +270,7 @@ operator>>(std::basic_istream &is, using random::uniform_int_distribution; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/uniform_real_distribution.h b/thrust/random/uniform_real_distribution.h index 3121045708..e6c5a7d88a 100644 --- a/thrust/random/uniform_real_distribution.h +++ b/thrust/random/uniform_real_distribution.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -268,7 +267,7 @@ operator>>(std::basic_istream &is, using random::uniform_real_distribution; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/random/xor_combine_engine.h b/thrust/random/xor_combine_engine.h index d5e86b7a9d..321f040333 100644 --- a/thrust/random/xor_combine_engine.h +++ b/thrust/random/xor_combine_engine.h @@ -29,8 +29,7 @@ #include #include // for size_t -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace random { @@ -265,7 +264,7 @@ operator>>(std::basic_istream &is, // import names into thrust:: using random::xor_combine_engine; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/reduce.h b/thrust/reduce.h index 96f683dc04..c7b378f729 100644 --- a/thrust/reduce.h +++ b/thrust/reduce.h @@ -26,9 +26,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reductions * \{ @@ -778,8 +776,6 @@ template - diff --git a/thrust/remove.h b/thrust/remove.h index b6000a0ba1..a57fcf211c 100644 --- a/thrust/remove.h +++ b/thrust/remove.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup stream_compaction Stream Compaction * \ingroup reordering @@ -799,8 +797,6 @@ template - diff --git a/thrust/replace.h b/thrust/replace.h index d80a66ad23..a5c0320c42 100644 --- a/thrust/replace.h +++ b/thrust/replace.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup transformations * \addtogroup replacing @@ -816,8 +814,6 @@ template - diff --git a/thrust/reverse.h b/thrust/reverse.h index b65a5d3092..056be200ad 100644 --- a/thrust/reverse.h +++ b/thrust/reverse.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reordering * \ingroup algorithms @@ -208,8 +206,6 @@ template /*! \} // end reordering */ - -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/scan.h b/thrust/scan.h index 340d258c06..668db72471 100644 --- a/thrust/scan.h +++ b/thrust/scan.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -1557,8 +1555,6 @@ template - diff --git a/thrust/scatter.h b/thrust/scatter.h index 4ad984482f..b8b0bd84f5 100644 --- a/thrust/scatter.h +++ b/thrust/scatter.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup scattering * \ingroup copying @@ -416,8 +414,6 @@ template - diff --git a/thrust/sequence.h b/thrust/sequence.h index d40fc553c9..fb3959e3ca 100644 --- a/thrust/sequence.h +++ b/thrust/sequence.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup transformations * \{ @@ -289,8 +287,7 @@ template /*! \} // end transformations */ - -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/set_operations.h b/thrust/set_operations.h index 1171129240..65a48d1b66 100644 --- a/thrust/set_operations.h +++ b/thrust/set_operations.h @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup set_operations Set Operations * \ingroup algorithms @@ -2956,8 +2954,6 @@ template - diff --git a/thrust/shuffle.h b/thrust/shuffle.h index 25b9046d58..d95327e29c 100644 --- a/thrust/shuffle.h +++ b/thrust/shuffle.h @@ -28,7 +28,7 @@ #include #include -namespace thrust { +THRUST_NAMESPACE_BEGIN /*! \addtogroup reordering * \ingroup algorithms @@ -173,7 +173,7 @@ template __host__ __device__ void shuffle_copy(RandomIterator first, RandomIterator last, OutputIterator result, URBG&& g); -} // namespace thrust +THRUST_NAMESPACE_END #include #endif diff --git a/thrust/sort.h b/thrust/sort.h index a6c17fc941..5cf9d6217a 100644 --- a/thrust/sort.h +++ b/thrust/sort.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup sorting * \ingroup algorithms @@ -1355,8 +1353,6 @@ template * \} // end reductions */ - -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/swap.h b/thrust/swap.h index 500868f117..d8a8be73c3 100644 --- a/thrust/swap.h +++ b/thrust/swap.h @@ -23,12 +23,7 @@ #include #include -// empty Doxygen comment below so namespace thrust's documentation will be extracted - -/*! - */ -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup utility * \{ @@ -184,8 +179,6 @@ template - diff --git a/thrust/system/cpp/detail/execution_policy.h b/thrust/system/cpp/detail/execution_policy.h index 27e4db8626..1a8193bf3a 100644 --- a/thrust/system/cpp/detail/execution_policy.h +++ b/thrust/system/cpp/detail/execution_policy.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { // put the canonical tag in the same ns as the backend's entry points @@ -77,5 +76,5 @@ using thrust::system::cpp::execution_policy; using thrust::system::cpp::tag; } // end cpp -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cpp/detail/memory.inl b/thrust/system/cpp/detail/memory.inl index bbb0bab78b..6361394d7a 100644 --- a/thrust/system/cpp/detail/memory.inl +++ b/thrust/system/cpp/detail/memory.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cpp @@ -47,5 +46,5 @@ void free(pointer ptr) } // end cpp } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cpp/detail/par.h b/thrust/system/cpp/detail/par.h index b884e7bba6..c56921327f 100644 --- a/thrust/system/cpp/detail/par.h +++ b/thrust/system/cpp/detail/par.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cpp @@ -58,5 +57,5 @@ using thrust::system::cpp::par; } // end cpp -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cpp/detail/vector.inl b/thrust/system/cpp/detail/vector.inl index 55a1fa4bac..d27cdad64d 100644 --- a/thrust/system/cpp/detail/vector.inl +++ b/thrust/system/cpp/detail/vector.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cpp @@ -122,5 +121,5 @@ template } // end cpp } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cpp/execution_policy.h b/thrust/system/cpp/execution_policy.h index d22b4ceeb7..0d8a9a3679 100644 --- a/thrust/system/cpp/execution_policy.h +++ b/thrust/system/cpp/execution_policy.h @@ -76,8 +76,7 @@ // define these entities here for the purpose of Doxygenating them // they are actually defined elsewhere #if 0 -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cpp @@ -151,7 +150,7 @@ static const unspecified par; } // end cpp } // end system -} // end thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cpp/memory.h b/thrust/system/cpp/memory.h index 376b8f4f5a..a18abeb8e4 100644 --- a/thrust/system/cpp/memory.h +++ b/thrust/system/cpp/memory.h @@ -27,7 +27,8 @@ #include #include -namespace thrust { namespace system { namespace cpp +THRUST_NAMESPACE_BEGIN +namespace system { namespace cpp { /*! Allocates an area of memory available to Thrust's cpp system. @@ -93,7 +94,7 @@ using thrust::system::cpp::free; using thrust::system::cpp::allocator; } // namespace cpp -} // namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/cpp/memory_resource.h b/thrust/system/cpp/memory_resource.h index e803583e9f..9f5d1e4cc9 100644 --- a/thrust/system/cpp/memory_resource.h +++ b/thrust/system/cpp/memory_resource.h @@ -26,7 +26,8 @@ #include -namespace thrust { namespace system { namespace cpp +THRUST_NAMESPACE_BEGIN +namespace system { namespace cpp { //! \cond @@ -63,5 +64,8 @@ typedef detail::native_resource universal_host_pinned_memory_resource; /*! \} */ -}}} // namespace thrust::system::cpp + +}} // namespace system::cpp + +THRUST_NAMESPACE_END diff --git a/thrust/system/cpp/pointer.h b/thrust/system/cpp/pointer.h index dac60a7e3c..f204fa3750 100644 --- a/thrust/system/cpp/pointer.h +++ b/thrust/system/cpp/pointer.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace system { namespace cpp +THRUST_NAMESPACE_BEGIN +namespace system { namespace cpp { /*! \p cpp::pointer stores a pointer to an object allocated in memory accessible @@ -112,5 +113,5 @@ using thrust::system::cpp::universal_pointer; using thrust::system::cpp::reference; } // namespace cpp -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cpp/vector.h b/thrust/system/cpp/vector.h index 0d328f134a..2a418dbc30 100644 --- a/thrust/system/cpp/vector.h +++ b/thrust/system/cpp/vector.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace system { namespace cpp +THRUST_NAMESPACE_BEGIN +namespace system { namespace cpp { /*! \p cpp::vector is a container that supports random access to elements, @@ -78,4 +79,4 @@ using thrust::system::cpp::vector; using thrust::system::cpp::universal_vector; } -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/config.h b/thrust/system/cuda/config.h index 38b3dba56a..a0da416243 100644 --- a/thrust/system/cuda/config.h +++ b/thrust/system/cuda/config.h @@ -68,9 +68,6 @@ #define THRUST_DEBUG_SYNC_FLAG false #endif -#define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub { -#define THRUST_CUB_NS_POSTFIX } } - #ifndef THRUST_IGNORE_CUB_VERSION_CHECK #include #include // This includes in newer releases. diff --git a/thrust/system/cuda/detail/adjacent_difference.h b/thrust/system/cuda/detail/adjacent_difference.h index 92fba765e1..4e7e18b2cd 100644 --- a/thrust/system/cuda/detail/adjacent_difference.h +++ b/thrust/system/cuda/detail/adjacent_difference.h @@ -45,8 +45,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template __host__ __device__ OutputIterator @@ -65,9 +64,9 @@ namespace __adjacent_difference { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BlockStoreAlgorithm _STORE_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_STORE_DIRECT> struct PtxPolicy { enum @@ -77,9 +76,9 @@ namespace __adjacent_difference { ITEMS_PER_TILE = BLOCK_THREADS * ITEMS_PER_THREAD }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; }; template @@ -115,9 +114,9 @@ namespace __adjacent_difference { }; typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; template @@ -131,9 +130,9 @@ namespace __adjacent_difference { }; typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; @@ -159,11 +158,11 @@ namespace __adjacent_difference { typedef typename core::BlockStore::type BlockStore; - typedef cub::BlockAdjacentDifference + typedef CUB_NS_QUALIFIER::BlockAdjacentDifference BlockAdjacentDifference; union TempStorage @@ -396,7 +395,7 @@ namespace __adjacent_difference { Size tile_size = difference_plan.items_per_tile; - Size num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + Size num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t tmp1 = num_tiles * sizeof(input_type); size_t vshmem_size = core::vshmem_size(difference_plan.shared_memory_size, @@ -533,7 +532,7 @@ adjacent_difference(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END // #include diff --git a/thrust/system/cuda/detail/assign_value.h b/thrust/system/cuda/detail/assign_value.h index f6fd987bf3..54d083342f 100644 --- a/thrust/system/cuda/detail/assign_value.h +++ b/thrust/system/cuda/detail/assign_value.h @@ -24,8 +24,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -98,5 +97,5 @@ inline __host__ __device__ } // end cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/async/copy.h b/thrust/system/cuda/detail/async/copy.h index 9b317cbb55..6f29707594 100644 --- a/thrust/system/cuda/detail/async/copy.h +++ b/thrust/system/cuda/detail/async/copy.h @@ -53,8 +53,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { namespace detail { @@ -530,7 +529,7 @@ THRUST_RETURNS( } // cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/customization.h b/thrust/system/cuda/detail/async/customization.h index aead7b12bb..6f125a6f41 100644 --- a/thrust/system/cuda/detail/async/customization.h +++ b/thrust/system/cuda/detail/async/customization.h @@ -48,8 +48,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { namespace detail { @@ -120,7 +119,7 @@ THRUST_RETURNS( }}} // namespace system::cuda::detail -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/exclusive_scan.h b/thrust/system/cuda/detail/async/exclusive_scan.h index 1ac46ecb55..0f35249b67 100644 --- a/thrust/system/cuda/detail/async/exclusive_scan.h +++ b/thrust/system/cuda/detail/async/exclusive_scan.h @@ -52,8 +52,7 @@ // fixed in CUB first). // - Need to check if CUB actually optimizes for sums before putting in effort -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda @@ -75,16 +74,16 @@ async_exclusive_scan_n(execution_policy& policy, InitialValueType init, BinaryOp op) { - using Dispatch32 = cub::DispatchScan; - using Dispatch64 = cub::DispatchScan; + using Dispatch32 = CUB_NS_QUALIFIER::DispatchScan; + using Dispatch64 = CUB_NS_QUALIFIER::DispatchScan; auto const device_alloc = get_async_device_allocator(policy); unique_eager_event ev; @@ -191,7 +190,7 @@ THRUST_RETURNS( } // namespace cuda_cub -} // namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/for_each.h b/thrust/system/cuda/detail/async/for_each.h index 750b7e829b..9f26883d00 100644 --- a/thrust/system/cuda/detail/async/for_each.h +++ b/thrust/system/cuda/detail/async/for_each.h @@ -47,8 +47,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { namespace detail { @@ -151,7 +150,7 @@ THRUST_RETURNS( } // cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/inclusive_scan.h b/thrust/system/cuda/detail/async/inclusive_scan.h index 6b3dcef914..8321141a44 100644 --- a/thrust/system/cuda/detail/async/inclusive_scan.h +++ b/thrust/system/cuda/detail/async/inclusive_scan.h @@ -52,8 +52,7 @@ // fixed in CUB first). // - Need to check if CUB actually optimizes for sums before putting in effort -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda @@ -73,15 +72,15 @@ async_inclusive_scan_n(execution_policy& policy, OutputIt out, BinaryOp op) { - using Dispatch32 = cub::DispatchScan; - using Dispatch64 = cub::DispatchScan; auto const device_alloc = get_async_device_allocator(policy); @@ -100,7 +99,7 @@ async_inclusive_scan_n(execution_policy& policy, first, out, op, - cub::NullType{}, + CUB_NS_QUALIFIER::NullType{}, n_fixed, nullptr, THRUST_DEBUG_SYNC_FLAG)); @@ -147,7 +146,7 @@ async_inclusive_scan_n(execution_policy& policy, first, out, op, - cub::NullType{}, + CUB_NS_QUALIFIER::NullType{}, n_fixed, user_raw_stream, THRUST_DEBUG_SYNC_FLAG)); @@ -186,7 +185,7 @@ THRUST_RETURNS( } // namespace cuda_cub -} // namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/reduce.h b/thrust/system/cuda/detail/async/reduce.h index 906928b27f..efd08b7438 100644 --- a/thrust/system/cuda/detail/async/reduce.h +++ b/thrust/system/cuda/detail/async/reduce.h @@ -49,8 +49,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { namespace detail { @@ -81,7 +80,7 @@ auto async_reduce_n( size_t tmp_size = 0; thrust::cuda_cub::throw_on_error( - cub::DeviceReduce::Reduce( + CUB_NS_QUALIFIER::DeviceReduce::Reduce( nullptr , tmp_size , first @@ -163,7 +162,7 @@ auto async_reduce_n( // Run reduction. thrust::cuda_cub::throw_on_error( - cub::DeviceReduce::Reduce( + CUB_NS_QUALIFIER::DeviceReduce::Reduce( tmp_ptr , tmp_size , first @@ -234,7 +233,7 @@ auto async_reduce_into_n( size_t tmp_size = 0; thrust::cuda_cub::throw_on_error( - cub::DeviceReduce::Reduce( + CUB_NS_QUALIFIER::DeviceReduce::Reduce( nullptr , tmp_size , first @@ -298,7 +297,7 @@ auto async_reduce_into_n( // Run reduction. thrust::cuda_cub::throw_on_error( - cub::DeviceReduce::Reduce( + CUB_NS_QUALIFIER::DeviceReduce::Reduce( tmp_ptr , tmp_size , first @@ -342,7 +341,7 @@ THRUST_RETURNS( } // cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/sort.h b/thrust/system/cuda/detail/async/sort.h index 3e357fde69..12c78292a0 100644 --- a/thrust/system/cuda/detail/async/sort.h +++ b/thrust/system/cuda/detail/async/sort.h @@ -53,8 +53,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { namespace detail { @@ -294,12 +293,12 @@ invoke_radix_sort( cudaStream_t stream , void* tmp_ptr , std::size_t& tmp_size -, cub::DoubleBuffer& keys +, CUB_NS_QUALIFIER::DoubleBuffer& keys , Size& n , StrictWeakOrdering ) { - return cub::DeviceRadixSort::SortKeys( + return CUB_NS_QUALIFIER::DeviceRadixSort::SortKeys( tmp_ptr , tmp_size , keys @@ -320,12 +319,12 @@ invoke_radix_sort( cudaStream_t stream , void* tmp_ptr , std::size_t& tmp_size -, cub::DoubleBuffer& keys +, CUB_NS_QUALIFIER::DoubleBuffer& keys , Size& n , StrictWeakOrdering ) { - return cub::DeviceRadixSort::SortKeysDescending( + return CUB_NS_QUALIFIER::DeviceRadixSort::SortKeysDescending( tmp_ptr , tmp_size , keys @@ -367,7 +366,7 @@ auto async_stable_sort_n( unique_eager_event e; - cub::DoubleBuffer keys( + CUB_NS_QUALIFIER::DoubleBuffer keys( raw_pointer_cast(&*first), nullptr ); @@ -514,7 +513,7 @@ THRUST_DECLTYPE_RETURNS( } // cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/async/transform.h b/thrust/system/cuda/detail/async/transform.h index 544da5cb9e..26703bc772 100644 --- a/thrust/system/cuda/detail/async/transform.h +++ b/thrust/system/cuda/detail/async/transform.h @@ -47,8 +47,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { namespace detail { @@ -155,7 +154,7 @@ THRUST_RETURNS( } // cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC diff --git a/thrust/system/cuda/detail/binary_search.h b/thrust/system/cuda/detail/binary_search.h index 1859824b83..f31b0d4afb 100644 --- a/thrust/system/cuda/detail/binary_search.h +++ b/thrust/system/cuda/detail/binary_search.h @@ -44,8 +44,7 @@ # define BS_SIMPLE #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __binary_search { @@ -186,9 +185,9 @@ namespace __binary_search { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockStoreAlgorithm _STORE_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_STORE_DIRECT> struct PtxPolicy { enum @@ -198,9 +197,9 @@ namespace __binary_search { ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; }; // PtxPolicy template @@ -217,9 +216,9 @@ namespace __binary_search { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_TRANSPOSE> type; }; @@ -236,9 +235,9 @@ namespace __binary_search { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; @@ -775,7 +774,7 @@ lower_bound(execution_policy& policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif #endif diff --git a/thrust/system/cuda/detail/copy.h b/thrust/system/cuda/detail/copy.h index ef51e4a5bc..cebdb05ca6 100644 --- a/thrust/system/cuda/detail/copy.h +++ b/thrust/system/cuda/detail/copy.h @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template __host__ __device__ OutputIt @@ -92,7 +91,7 @@ copy_n(cross_system systems, OutputIterator result); } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END @@ -100,8 +99,7 @@ copy_n(cross_system systems, #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -192,7 +190,7 @@ copy_n(cross_system systems, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/system/cuda/detail/copy_if.h b/thrust/system/cuda/detail/copy_if.h index 747a3a83b0..f31e748e40 100644 --- a/thrust/system/cuda/detail/copy_if.h +++ b/thrust/system/cuda/detail/copy_if.h @@ -43,8 +43,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // XXX declare generic copy_if interface // to avoid circulular dependency from thrust/copy.h template @@ -72,9 +71,9 @@ namespace __copy_if { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> struct PtxPolicy { enum @@ -83,9 +82,9 @@ namespace __copy_if { ITEMS_PER_THREAD = _ITEMS_PER_THREAD, ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD, }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; }; // struct PtxPolicy template @@ -104,9 +103,9 @@ namespace __copy_if { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning<350> @@ -124,9 +123,9 @@ namespace __copy_if { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning<350> @@ -143,9 +142,9 @@ namespace __copy_if { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning<300> @@ -162,7 +161,7 @@ namespace __copy_if { typedef typename iterator_traits::value_type item_type; typedef typename iterator_traits::value_type stencil_type; - typedef cub::ScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ScanTileState ScanTileState; template struct PtxPlan : Tuning::type @@ -175,13 +174,13 @@ namespace __copy_if { typedef typename core::BlockLoad::type BlockLoadItems; typedef typename core::BlockLoad::type BlockLoadStencil; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan::type copy_if_plan = copy_if_agent::get_plan(stream); int tile_size = copy_if_plan.items_per_tile; - size_t num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t vshmem_size = core::vshmem_size(copy_if_plan.shared_memory_size, num_tiles); @@ -653,7 +652,7 @@ namespace __copy_if { void* allocations[2] = {NULL, NULL}; - status = cub::AliasTemporaries(d_temp_storage, + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes); @@ -853,7 +852,7 @@ copy_if(execution_policy &policy, } // func copy_if } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include #endif diff --git a/thrust/system/cuda/detail/core/agent_launcher.h b/thrust/system/cuda/detail/core/agent_launcher.h index 7788481c7b..1850fc9f46 100644 --- a/thrust/system/cuda/detail/core/agent_launcher.h +++ b/thrust/system/cuda/detail/core/agent_launcher.h @@ -42,8 +42,7 @@ template class ID_impl; template class Foo { ID_impl t;}; #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace core { @@ -536,7 +535,7 @@ namespace core { max_blocks_per_sm_impl(K k, int block_threads) { int occ; - cudaError_t status = cub::MaxSmOccupancy(occ, k, block_threads); + cudaError_t status = CUB_NS_QUALIFIER::MaxSmOccupancy(occ, k, block_threads); return cuda_optional(status == cudaSuccess ? occ : -1, status); } @@ -1180,5 +1179,5 @@ namespace core { } // namespace core } -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/core/alignment.h b/thrust/system/cuda/detail/core/alignment.h index 1dc21ebcec..bb60f4682a 100644 --- a/thrust/system/cuda/detail/core/alignment.h +++ b/thrust/system/cuda/detail/core/alignment.h @@ -20,8 +20,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace alignment_of_detail { @@ -246,4 +245,4 @@ struct aligned_storage } // end cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/core/triple_chevron_launch.h b/thrust/system/cuda/detail/core/triple_chevron_launch.h index deeffac9da..b6d4086697 100644 --- a/thrust/system/cuda/detail/core/triple_chevron_launch.h +++ b/thrust/system/cuda/detail/core/triple_chevron_launch.h @@ -32,8 +32,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace launcher { @@ -973,4 +972,4 @@ namespace launcher { } // namespace launcher } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/core/util.h b/thrust/system/cuda/detail/core/util.h index ea4ed6400b..201cec31fa 100644 --- a/thrust/system/cuda/detail/core/util.h +++ b/thrust/system/cuda/detail/core/util.h @@ -36,8 +36,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace core { @@ -419,7 +418,7 @@ namespace core { #ifdef __CUDA_ARCH__ plan = get_agent_plan_dev(); #else - static cub::Mutex mutex; + static CUB_NS_QUALIFIER::Mutex mutex; bool lock = false; if (d_ptr == 0) { @@ -532,10 +531,10 @@ namespace core { typedef typename thrust::detail::conditional< is_contiguous_iterator::value, - cub::CacheModifiedInputIterator, - It>::type type; + CUB_NS_QUALIFIER::CacheModifiedInputIterator, + It>::type type; }; // struct Iterator template @@ -574,16 +573,13 @@ namespace core { class T = typename iterator_traits::value_type> struct BlockLoad { - typedef cub::BlockLoad::type::ver> - - - type; + using type = CUB_NS_QUALIFIER::BlockLoad::type::ver>; }; // BlockStore @@ -594,16 +590,16 @@ namespace core { class T = typename iterator_traits::value_type> struct BlockStore { - typedef cub::BlockStore::type::ver> - type; + using type = CUB_NS_QUALIFIER::BlockStore::type::ver>; }; - // cuda_otional + + // cuda_optional // -------------- // used for function that return cudaError_t along with the result // @@ -636,25 +632,25 @@ namespace core { get_ptx_version() { int ptx_version = 0; - cudaError_t status = cub::PtxVersion(ptx_version); + cudaError_t status = CUB_NS_QUALIFIER::PtxVersion(ptx_version); return cuda_optional(ptx_version, status); } cudaError_t THRUST_RUNTIME_FUNCTION sync_stream(cudaStream_t stream) { - return cub::SyncStream(stream); + return CUB_NS_QUALIFIER::SyncStream(stream); } inline void __device__ sync_threadblock() { - cub::CTA_SYNC(); + CUB_NS_QUALIFIER::CTA_SYNC(); } #define CUDA_CUB_RET_IF_FAIL(e) \ { \ auto const error = (e); \ - if (cub::Debug(error, __FILE__, __LINE__)) return error; \ + if (CUB_NS_QUALIFIER::Debug(error, __FILE__, __LINE__)) return error; \ } // uninitialized @@ -664,7 +660,7 @@ namespace core { template struct uninitialized { - typedef typename cub::UnitWord::DeviceWord DeviceWord; + typedef typename CUB_NS_QUALIFIER::UnitWord::DeviceWord DeviceWord; enum { @@ -756,10 +752,10 @@ namespace core { void* (&allocations)[ALLOCATIONS], size_t (&allocation_sizes)[ALLOCATIONS]) { - return cub::AliasTemporaries(storage_ptr, - storage_size, - allocations, - allocation_sizes); + return CUB_NS_QUALIFIER::AliasTemporaries(storage_ptr, + storage_size, + allocations, + allocation_sizes); } @@ -770,4 +766,4 @@ using core::sm35; using core::sm30; } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/count.h b/thrust/system/cuda/detail/count.h index 0d8f0c02dd..af12658851 100644 --- a/thrust/system/cuda/detail/count.h +++ b/thrust/system/cuda/detail/count.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/cross_system.h b/thrust/system/cuda/detail/cross_system.h index 8ffdfd94f6..2e23a052e7 100644 --- a/thrust/system/cuda/detail/cross_system.h +++ b/thrust/system/cuda/detail/cross_system.h @@ -30,8 +30,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template @@ -340,5 +339,5 @@ namespace cuda_cub { } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/equal.h b/thrust/system/cuda/detail/equal.h index dd5e7d6863..65fa6de884 100644 --- a/thrust/system/cuda/detail/equal.h +++ b/thrust/system/cuda/detail/equal.h @@ -32,8 +32,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template & policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/error.inl b/thrust/system/cuda/detail/error.inl index 5c689b4998..6997a7fe64 100644 --- a/thrust/system/cuda/detail/error.inl +++ b/thrust/system/cuda/detail/error.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -94,5 +93,5 @@ const error_category &cuda_category(void) } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/execution_policy.h b/thrust/system/cuda/detail/execution_policy.h index ee49a60cb4..a01c857cc6 100644 --- a/thrust/system/cuda/detail/execution_policy.h +++ b/thrust/system/cuda/detail/execution_policy.h @@ -38,8 +38,7 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -95,5 +94,5 @@ using thrust::cuda_cub::execution_policy; } // namespace cuda -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/extrema.h b/thrust/system/cuda/detail/extrema.h index 683dd521ba..f77143435e 100644 --- a/thrust/system/cuda/detail/extrema.h +++ b/thrust/system/cuda/detail/extrema.h @@ -39,8 +39,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __extrema { @@ -206,8 +205,8 @@ namespace __extrema { template get_max_blocks_per_sm, - cub::GridQueue, + CUB_NS_QUALIFIER::GridEvenShare, + CUB_NS_QUALIFIER::GridQueue, ReductionOp>(reduce_plan); CUDA_CUB_RET_IF_FAIL(max_blocks_per_sm.status()); @@ -218,7 +217,7 @@ namespace __extrema { int sm_oversubscription = 5; int max_blocks = reduce_device_occupancy * sm_oversubscription; - cub::GridEvenShare even_share; + CUB_NS_QUALIFIER::GridEvenShare even_share; even_share.DispatchInit(num_items, max_blocks, reduce_plan.items_per_tile); @@ -233,13 +232,13 @@ namespace __extrema { size_t allocation_sizes[3] = { max_blocks * sizeof(T), // bytes needed for privatized block reductions - cub::GridQueue::AllocationSize(), // bytes needed for grid queue descriptor0 + CUB_NS_QUALIFIER::GridQueue::AllocationSize(), // bytes needed for grid queue descriptor0 vshmem_size // size of virtualized shared memory storage }; - status = cub::AliasTemporaries(d_temp_storage, - temp_storage_bytes, - allocations, - allocation_sizes); + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, + temp_storage_bytes, + allocations, + allocation_sizes); CUDA_CUB_RET_IF_FAIL(status); if (d_temp_storage == NULL) { @@ -247,21 +246,21 @@ namespace __extrema { } T *d_block_reductions = (T*) allocations[0]; - cub::GridQueue queue(allocations[1]); + CUB_NS_QUALIFIER::GridQueue queue(allocations[1]); char *vshmem_ptr = vshmem_size > 0 ? (char *)allocations[2] : NULL; // Get grid size for device_reduce_sweep_kernel int reduce_grid_size = 0; - if (reduce_plan.grid_mapping == cub::GRID_MAPPING_RAKE) + if (reduce_plan.grid_mapping == CUB_NS_QUALIFIER::GRID_MAPPING_RAKE) { // Work is distributed evenly reduce_grid_size = even_share.grid_size; } - else if (reduce_plan.grid_mapping == cub::GRID_MAPPING_DYNAMIC) + else if (reduce_plan.grid_mapping == CUB_NS_QUALIFIER::GRID_MAPPING_DYNAMIC) { // Work is distributed dynamically - size_t num_tiles = cub::DivideAndRoundUp(num_items, reduce_plan.items_per_tile); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, reduce_plan.items_per_tile); // if not enough to fill the device with threadblocks // then fill the device with threadblocks @@ -565,5 +564,5 @@ minmax_element(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/fill.h b/thrust/system/cuda/detail/fill.h index 078e1b3781..3595c8ab9c 100644 --- a/thrust/system/cuda/detail/fill.h +++ b/thrust/system/cuda/detail/fill.h @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __fill { @@ -90,5 +89,5 @@ fill(execution_policy& policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/find.h b/thrust/system/cuda/detail/find.h index f6a1e59d10..8e0e0039dd 100644 --- a/thrust/system/cuda/detail/find.h +++ b/thrust/system/cuda/detail/find.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { // XXX forward declare to circumvent circular depedency @@ -67,13 +66,12 @@ find(execution_policy &policy, T const& value); }; // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __find_if { @@ -215,5 +213,5 @@ find(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/for_each.h b/thrust/system/cuda/detail/for_each.h index 542dcf754e..44675a0dc2 100644 --- a/thrust/system/cuda/detail/for_each.h +++ b/thrust/system/cuda/detail/for_each.h @@ -36,8 +36,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -105,5 +104,5 @@ namespace cuda_cub { } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/future.inl b/thrust/system/cuda/detail/future.inl index 606a0cec5e..f23184aae9 100644 --- a/thrust/system/cuda/detail/future.inl +++ b/thrust/system/cuda/detail/future.inl @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // Forward declaration. struct new_stream_t; @@ -1367,7 +1366,7 @@ THRUST_DECLTYPE_RETURNS(std::move(dependency)) }} // namespace system::cuda -} // end namespace thrust +THRUST_NAMESPACE_END #endif // C++14 diff --git a/thrust/system/cuda/detail/gather.h b/thrust/system/cuda/detail/gather.h index 31ca3fd561..adc5ec0053 100644 --- a/thrust/system/cuda/detail/gather.h +++ b/thrust/system/cuda/detail/gather.h @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template & policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/generate.h b/thrust/system/cuda/detail/generate.h index df77901e21..decac0eff8 100644 --- a/thrust/system/cuda/detail/generate.h +++ b/thrust/system/cuda/detail/generate.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { // for_each functor @@ -86,5 +85,5 @@ generate(execution_policy &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/get_value.h b/thrust/system/cuda/detail/get_value.h index 9fbb0b548c..631c123df5 100644 --- a/thrust/system/cuda/detail/get_value.h +++ b/thrust/system/cuda/detail/get_value.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -93,6 +92,6 @@ inline __host__ __device__ } // end cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/inner_product.h b/thrust/system/cuda/detail/inner_product.h index bd6aec606c..5c1e7b6d54 100644 --- a/thrust/system/cuda/detail/inner_product.h +++ b/thrust/system/cuda/detail/inner_product.h @@ -33,8 +33,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -90,5 +89,5 @@ inner_product(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/internal/copy_cross_system.h b/thrust/system/cuda/detail/internal/copy_cross_system.h index e17d99ea45..c0e26ad215 100644 --- a/thrust/system/cuda/detail/internal/copy_cross_system.h +++ b/thrust/system/cuda/detail/internal/copy_cross_system.h @@ -40,8 +40,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __copy { @@ -240,4 +239,4 @@ namespace __copy { } // namespace __copy } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/internal/copy_device_to_device.h b/thrust/system/cuda/detail/internal/copy_device_to_device.h index 7a6631d903..f32cb6f31a 100644 --- a/thrust/system/cuda/detail/internal/copy_device_to_device.h +++ b/thrust/system/cuda/detail/internal/copy_device_to_device.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __copy { @@ -60,5 +59,5 @@ namespace __copy { } // namespace __copy } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/iter_swap.h b/thrust/system/cuda/detail/iter_swap.h index 353bb18513..12003c188a 100644 --- a/thrust/system/cuda/detail/iter_swap.h +++ b/thrust/system/cuda/detail/iter_swap.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -62,5 +61,5 @@ void iter_swap(thrust::cuda::execution_policy &, Pointer1 a, Poin } // end cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/make_unsigned_special.h b/thrust/system/cuda/detail/make_unsigned_special.h index 683647cbed..7c7e8d5466 100644 --- a/thrust/system/cuda/detail/make_unsigned_special.h +++ b/thrust/system/cuda/detail/make_unsigned_special.h @@ -16,8 +16,7 @@ #pragma once -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace detail { @@ -38,5 +37,5 @@ namespace detail { } } -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/malloc_and_free.h b/thrust/system/cuda/detail/malloc_and_free.h index 3d72381b5b..121a766370 100644 --- a/thrust/system/cuda/detail/malloc_and_free.h +++ b/thrust/system/cuda/detail/malloc_and_free.h @@ -30,16 +30,15 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { #ifdef THRUST_CACHING_DEVICE_MALLOC #define __CUB_CACHING_MALLOC #ifndef __CUDA_ARCH__ -inline cub::CachingDeviceAllocator &get_allocator() +inline CUB_NS_QUALIFIER::CachingDeviceAllocator &get_allocator() { - static cub::CachingDeviceAllocator g_allocator(true); + static CUB_NS_QUALIFIER::CachingDeviceAllocator g_allocator(true); return g_allocator; } #endif @@ -57,7 +56,7 @@ void *malloc(execution_policy &, std::size_t n) if (THRUST_IS_HOST_CODE) { #if THRUST_INCLUDE_HOST_CODE #ifdef __CUB_CACHING_MALLOC - cub::CachingDeviceAllocator &alloc = get_allocator(); + CUB_NS_QUALIFIER::CachingDeviceAllocator &alloc = get_allocator(); cudaError_t status = alloc.DeviceAllocate(&result, n); #else cudaError_t status = cudaMalloc(&result, n); @@ -86,7 +85,7 @@ void free(execution_policy &, Pointer ptr) if (THRUST_IS_HOST_CODE) { #if THRUST_INCLUDE_HOST_CODE #ifdef __CUB_CACHING_MALLOC - cub::CachingDeviceAllocator &alloc = get_allocator(); + CUB_NS_QUALIFIER::CachingDeviceAllocator &alloc = get_allocator(); cudaError_t status = alloc.DeviceFree(thrust::raw_pointer_cast(ptr)); #else cudaError_t status = cudaFree(thrust::raw_pointer_cast(ptr)); @@ -101,4 +100,4 @@ void free(execution_policy &, Pointer ptr) } // end free() } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/memory.inl b/thrust/system/cuda/detail/memory.inl index 82a04b67dd..f6fc98359a 100644 --- a/thrust/system/cuda/detail/memory.inl +++ b/thrust/system/cuda/detail/memory.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -49,5 +48,5 @@ void free(pointer ptr) } // end free() } // end cuda_cub -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/merge.h b/thrust/system/cuda/detail/merge.h index 5a223b6060..ce8c5f9ec1 100644 --- a/thrust/system/cuda/detail/merge.h +++ b/thrust/system/cuda/detail/merge.h @@ -43,8 +43,7 @@ j * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __merge { @@ -128,9 +127,9 @@ namespace __merge { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockStoreAlgorithm _STORE_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_STORE_DIRECT> struct PtxPolicy { enum @@ -140,9 +139,9 @@ namespace __merge { ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD, }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; }; // PtxPolicy template + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm300 @@ -241,9 +240,9 @@ namespace __merge { typedef PtxPolicy<512, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm52 @@ -259,9 +258,9 @@ namespace __merge { typedef PtxPolicy<512, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm52 @@ -279,9 +278,9 @@ namespace __merge { typedef PtxPolicy<256, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm350 @@ -1014,5 +1013,5 @@ merge_by_key(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/mismatch.h b/thrust/system/cuda/detail/mismatch.h index 98c462e844..d5f7ee8cbb 100644 --- a/thrust/system/cuda/detail/mismatch.h +++ b/thrust/system/cuda/detail/mismatch.h @@ -33,8 +33,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template & policy, InputIt1 last1, InputIt2 first2); } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template & policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/par.h b/thrust/system/cuda/detail/par.h index 48a2e19d43..adbc48d4bf 100644 --- a/thrust/system/cuda/detail/par.h +++ b/thrust/system/cuda/detail/par.h @@ -38,8 +38,7 @@ #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template @@ -121,5 +120,5 @@ namespace cuda { using thrust::cuda_cub::par; } // namespace cuda -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/par_to_seq.h b/thrust/system/cuda/detail/par_to_seq.h index 22c4e58386..1a74d81673 100644 --- a/thrust/system/cuda/detail/par_to_seq.h +++ b/thrust/system/cuda/detail/par_to_seq.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template @@ -88,4 +87,4 @@ cvt_to_seq(Policy& policy) #endif } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/parallel_for.h b/thrust/system/cuda/detail/parallel_for.h index 17fa7e7a86..56e3914d84 100644 --- a/thrust/system/cuda/detail/parallel_for.h +++ b/thrust/system/cuda/detail/parallel_for.h @@ -36,8 +36,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -174,5 +173,5 @@ parallel_for(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/partition.h b/thrust/system/cuda/detail/partition.h index e656e04f75..0ff134ff72 100644 --- a/thrust/system/cuda/detail/partition.h +++ b/thrust/system/cuda/detail/partition.h @@ -45,17 +45,16 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __partition { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> struct PtxPolicy { enum @@ -64,9 +63,9 @@ namespace __partition { ITEMS_PER_THREAD = _ITEMS_PER_THREAD, ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; }; // struct PtxPolicy template @@ -85,9 +84,9 @@ namespace __partition { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning<350> @@ -104,9 +103,9 @@ namespace __partition { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning<300> @@ -137,7 +136,7 @@ namespace __partition { typedef typename iterator_traits::value_type stencil_type; - typedef cub::ScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ScanTileState ScanTileState; template struct PtxPlan : Tuning::type @@ -150,17 +149,17 @@ namespace __partition { typedef typename core::BlockLoad::type BlockLoadItems; typedef typename core::BlockLoad::type BlockLoadStencil; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan + typedef CUB_NS_QUALIFIER::BlockScan BlockScan; @@ -441,7 +440,7 @@ namespace __partition { { TilePrefixCallback prefix_cb(tile_state, temp_storage.scan_storage.prefix, - cub::Sum(), + CUB_NS_QUALIFIER::Sum(), tile_idx); BlockScan(temp_storage.scan_storage.scan) .ExclusiveSum(selection_flags, @@ -647,7 +646,7 @@ namespace __partition { typename get_plan::type partition_plan = partition_agent::get_plan(stream); int tile_size = partition_plan.items_per_tile; - size_t num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t vshmem_storage = core::vshmem_size(partition_plan.shared_memory_size, num_tiles); @@ -662,10 +661,10 @@ namespace __partition { void* allocations[2] = {NULL, NULL}; - status = cub::AliasTemporaries(d_temp_storage, - temp_storage_bytes, - allocations, - allocation_sizes); + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, + temp_storage_bytes, + allocations, + allocation_sizes); CUDA_CUB_RET_IF_FAIL(status); if (d_temp_storage == NULL) @@ -1144,5 +1143,5 @@ is_partitioned(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/per_device_resource.h b/thrust/system/cuda/detail/per_device_resource.h index 68f7194af3..414ea77881 100644 --- a/thrust/system/cuda/detail/per_device_resource.h +++ b/thrust/system/cuda/detail/per_device_resource.h @@ -43,8 +43,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -65,7 +64,7 @@ MR * get_per_device_resource(execution_policy&) } -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/reduce.h b/thrust/system/cuda/detail/reduce.h index fac2b1d7a6..80056a44c0 100644 --- a/thrust/system/cuda/detail/reduce.h +++ b/thrust/system/cuda/detail/reduce.h @@ -48,8 +48,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declare generic reduce // to circumvent circular dependency @@ -76,9 +75,9 @@ namespace __reduce { template + CUB_NS_QUALIFIER::BlockReduceAlgorithm _BLOCK_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_REDUCE_RAKING, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::GridMappingStrategy _GRID_MAPPING = CUB_NS_QUALIFIER::GRID_MAPPING_DYNAMIC> struct PtxPolicy { enum @@ -89,9 +88,9 @@ namespace __reduce { ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD }; - static const cub::BlockReduceAlgorithm BLOCK_ALGORITHM = _BLOCK_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::GridMappingStrategy GRID_MAPPING = _GRID_MAPPING; + static const CUB_NS_QUALIFIER::BlockReduceAlgorithm BLOCK_ALGORITHM = _BLOCK_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::GridMappingStrategy GRID_MAPPING = _GRID_MAPPING; }; // struct PtxPolicy template @@ -111,9 +110,9 @@ namespace __reduce { typedef PtxPolicy<256, CUB_MAX(1, 20 / SCALE_FACTOR_4B), 2, - cub::BLOCK_REDUCE_WARP_REDUCTIONS, - cub::LOAD_DEFAULT, - cub::GRID_MAPPING_RAKE> + CUB_NS_QUALIFIER::BLOCK_REDUCE_WARP_REDUCTIONS, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::GRID_MAPPING_RAKE> type; }; // Tuning sm30 @@ -124,18 +123,18 @@ namespace __reduce { typedef PtxPolicy<128, CUB_MAX(1, 24 / Tuning::SCALE_FACTOR_1B), 4, - cub::BLOCK_REDUCE_WARP_REDUCTIONS, - cub::LOAD_LDG, - cub::GRID_MAPPING_DYNAMIC> + CUB_NS_QUALIFIER::BLOCK_REDUCE_WARP_REDUCTIONS, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::GRID_MAPPING_DYNAMIC> ReducePolicy1B; // ReducePolicy4B types (GTX Titan: 255.1 GB/s @ 48M 4B items) typedef PtxPolicy<256, CUB_MAX(1, 20 / Tuning::SCALE_FACTOR_4B), 4, - cub::BLOCK_REDUCE_WARP_REDUCTIONS, - cub::LOAD_LDG, - cub::GRID_MAPPING_DYNAMIC> + CUB_NS_QUALIFIER::BLOCK_REDUCE_WARP_REDUCTIONS, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::GRID_MAPPING_DYNAMIC> ReducePolicy4B; typedef typename thrust::detail::conditional<(sizeof(T) < 4), @@ -161,9 +160,9 @@ namespace __reduce { // typedef Tuning tuning; - typedef typename cub::CubVector Vector; + typedef typename CUB_NS_QUALIFIER::CubVector Vector; typedef typename core::LoadIterator::type LoadIt; - typedef cub::BlockReduce BlockReduce; - typedef cub::CacheModifiedInputIterator VectorLoadIt; @@ -194,7 +193,7 @@ namespace __reduce { // struct Plan : core::AgentPlan { - cub::GridMappingStrategy grid_mapping; + CUB_NS_QUALIFIER::GridMappingStrategy grid_mapping; template THRUST_RUNTIME_FUNCTION @@ -297,14 +296,14 @@ namespace __reduce { T items[ITEMS_PER_THREAD]; // Load items in striped fashion - cub::LoadDirectStriped(threadIdx.x, + CUB_NS_QUALIFIER::LoadDirectStriped(threadIdx.x, load_it + block_offset, items); // Reduce items within each thread stripe thread_aggregate = - (IS_FIRST_TILE) ? cub::internal::ThreadReduce(items, reduction_op) - : cub::internal::ThreadReduce(items, reduction_op, + (IS_FIRST_TILE) ? CUB_NS_QUALIFIER::internal::ThreadReduce(items, reduction_op) + : CUB_NS_QUALIFIER::internal::ThreadReduce(items, reduction_op, thread_aggregate); } @@ -343,8 +342,8 @@ namespace __reduce { // Reduce items within each thread stripe thread_aggregate = - (IS_FIRST_TILE) ? cub::internal::ThreadReduce(items, reduction_op) - : cub::internal::ThreadReduce(items, reduction_op, + (IS_FIRST_TILE) ? CUB_NS_QUALIFIER::internal::ThreadReduce(items, reduction_op) + : CUB_NS_QUALIFIER::internal::ThreadReduce(items, reduction_op, thread_aggregate); } @@ -460,9 +459,9 @@ namespace __reduce { // THRUST_DEVICE_FUNCTION T consume_tiles(Size /*num_items*/, - cub::GridEvenShare &even_share, - cub::GridQueue & /*queue*/, - thrust::detail::integral_constant /*is_rake*/) + CUB_NS_QUALIFIER::GridEvenShare &even_share, + CUB_NS_QUALIFIER::GridQueue & /*queue*/, + thrust::detail::integral_constant /*is_rake*/) { typedef is_true attempt_vec; typedef is_true path_a; @@ -470,7 +469,7 @@ namespace __reduce { // Initialize even-share descriptor for this thread block even_share - .template BlockInit(); + .template BlockInit(); return is_aligned(input_it, attempt_vec()) ? consume_range_impl(even_share.block_offset, @@ -491,7 +490,7 @@ namespace __reduce { template THRUST_DEVICE_FUNCTION T consume_tiles_impl(Size num_items, - cub::GridQueue queue, + CUB_NS_QUALIFIER::GridQueue queue, CAN_VECTORIZE can_vectorize) { using core::sync_threadblock; @@ -578,9 +577,9 @@ namespace __reduce { THRUST_DEVICE_FUNCTION T consume_tiles( Size num_items, - cub::GridEvenShare &/*even_share*/, - cub::GridQueue & queue, - thrust::detail::integral_constant) + CUB_NS_QUALIFIER::GridEvenShare &/*even_share*/, + CUB_NS_QUALIFIER::GridQueue & queue, + thrust::detail::integral_constant) { typedef is_true attempt_vec; typedef is_true path_a; @@ -646,14 +645,14 @@ namespace __reduce { THRUST_AGENT_ENTRY(InputIt input_it, OutputIt output_it, Size num_items, - cub::GridEvenShare even_share, - cub::GridQueue queue, + CUB_NS_QUALIFIER::GridEvenShare even_share, + CUB_NS_QUALIFIER::GridQueue queue, ReductionOp reduction_op, char * shmem) { TempStorage& storage = *reinterpret_cast(shmem); - typedef thrust::detail::integral_constant grid_mapping; + typedef thrust::detail::integral_constant grid_mapping; T block_aggregate = impl(storage, input_it, reduction_op) @@ -677,7 +676,7 @@ namespace __reduce { // Agent entry point //--------------------------------------------------------------------- - THRUST_AGENT_ENTRY(cub::GridQueue grid_queue, + THRUST_AGENT_ENTRY(CUB_NS_QUALIFIER::GridQueue grid_queue, Size num_items, char * /*shmem*/) { @@ -749,8 +748,8 @@ namespace __reduce { template get_max_blocks_per_sm, - cub::GridQueue, + CUB_NS_QUALIFIER::GridEvenShare, + CUB_NS_QUALIFIER::GridQueue, ReductionOp>(reduce_plan); CUDA_CUB_RET_IF_FAIL(max_blocks_per_sm.status()); @@ -761,7 +760,7 @@ namespace __reduce { int sm_oversubscription = 5; int max_blocks = reduce_device_occupancy * sm_oversubscription; - cub::GridEvenShare even_share; + CUB_NS_QUALIFIER::GridEvenShare even_share; even_share.DispatchInit(static_cast(num_items), max_blocks, reduce_plan.items_per_tile); @@ -776,10 +775,10 @@ namespace __reduce { size_t allocation_sizes[3] = { max_blocks * sizeof(T), // bytes needed for privatized block reductions - cub::GridQueue::AllocationSize(), // bytes needed for grid queue descriptor0 + CUB_NS_QUALIFIER::GridQueue::AllocationSize(), // bytes needed for grid queue descriptor0 vshmem_size // size of virtualized shared memory storage }; - status = cub::AliasTemporaries(d_temp_storage, + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes); @@ -790,21 +789,21 @@ namespace __reduce { } T *d_block_reductions = (T*) allocations[0]; - cub::GridQueue queue(allocations[1]); + CUB_NS_QUALIFIER::GridQueue queue(allocations[1]); char *vshmem_ptr = vshmem_size > 0 ? (char *)allocations[2] : NULL; // Get grid size for device_reduce_sweep_kernel int reduce_grid_size = 0; - if (reduce_plan.grid_mapping == cub::GRID_MAPPING_RAKE) + if (reduce_plan.grid_mapping == CUB_NS_QUALIFIER::GRID_MAPPING_RAKE) { // Work is distributed evenly reduce_grid_size = even_share.grid_size; } - else if (reduce_plan.grid_mapping == cub::GRID_MAPPING_DYNAMIC) + else if (reduce_plan.grid_mapping == CUB_NS_QUALIFIER::GRID_MAPPING_DYNAMIC) { // Work is distributed dynamically - size_t num_tiles = cub::DivideAndRoundUp(num_items, reduce_plan.items_per_tile); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, reduce_plan.items_per_tile); // if not enough to fill the device with threadblocks // then fill the device with threadblocks @@ -944,8 +943,8 @@ T reduce_n_impl(execution_policy& policy, size_t tmp_size = 0; THRUST_INDEX_TYPE_DISPATCH2(status, - cub::DeviceReduce::Reduce, - (cub::DispatchReduce< + CUB_NS_QUALIFIER::DeviceReduce::Reduce, + (CUB_NS_QUALIFIER::DispatchReduce< InputIt, T*, Size, BinaryOp >::Dispatch), num_items, @@ -972,8 +971,8 @@ T reduce_n_impl(execution_policy& policy, T* ret_ptr = thrust::detail::aligned_reinterpret_cast(tmp.data().get()); void* tmp_ptr = static_cast((tmp.data() + sizeof(T)).get()); THRUST_INDEX_TYPE_DISPATCH2(status, - cub::DeviceReduce::Reduce, - (cub::DispatchReduce< + CUB_NS_QUALIFIER::DeviceReduce::Reduce, + (CUB_NS_QUALIFIER::DispatchReduce< InputIt, T*, Size, BinaryOp >::Dispatch), num_items, @@ -1069,7 +1068,7 @@ reduce(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/system/cuda/detail/reduce_by_key.h b/thrust/system/cuda/detail/reduce_by_key.h index e24c5cc057..604c70a59d 100644 --- a/thrust/system/cuda/detail/reduce_by_key.h +++ b/thrust/system/cuda/detail/reduce_by_key.h @@ -49,8 +49,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> struct PtxPolicy { enum @@ -91,9 +90,9 @@ namespace __reduce_by_key { ITEMS_PER_TILE = BLOCK_THREADS * ITEMS_PER_THREAD }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; }; // struct PtxPolicy template @@ -122,9 +121,9 @@ namespace __reduce_by_key { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning sm30 @@ -151,9 +150,9 @@ namespace __reduce_by_key { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning sm35 @@ -180,9 +179,9 @@ namespace __reduce_by_key { typedef PtxPolicy<256, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning sm52 @@ -200,11 +199,11 @@ namespace __reduce_by_key { typedef typename iterator_traits::value_type value_type; typedef Size size_type; - typedef cub::KeyValuePair size_value_pair_t; - typedef cub::KeyValuePair key_value_pair_t; + typedef CUB_NS_QUALIFIER::KeyValuePair size_value_pair_t; + typedef CUB_NS_QUALIFIER::KeyValuePair key_value_pair_t; - typedef cub::ReduceByKeyScanTileState ScanTileState; - typedef cub::ReduceBySegmentOp ReduceBySegmentOp; + typedef CUB_NS_QUALIFIER::ReduceByKeyScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ReduceBySegmentOp ReduceBySegmentOp; template struct PtxPlan : Tuning::type @@ -217,19 +216,19 @@ namespace __reduce_by_key { typedef typename core::BlockLoad::type BlockLoadKeys; typedef typename core::BlockLoad::type BlockLoadValues; - typedef cub::BlockDiscontinuity BlockDiscontinuityKeys; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan inequality_op; + CUB_NS_QUALIFIER::InequalityWrapper inequality_op; ReduceBySegmentOp scan_op; //--------------------------------------------------------------------- @@ -911,7 +910,7 @@ namespace __reduce_by_key { // Number of input tiles int tile_size = reduce_by_key_plan.items_per_tile; - Size num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + Size num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t vshmem_size = core::vshmem_size(reduce_by_key_plan.shared_memory_size, num_tiles); @@ -921,7 +920,7 @@ namespace __reduce_by_key { CUDA_CUB_RET_IF_FAIL(status); void *allocations[2] = {NULL, NULL}; - status = cub::AliasTemporaries(d_temp_storage, + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes); @@ -1162,7 +1161,7 @@ reduce_by_key(execution_policy &policy, } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/system/cuda/detail/remove.h b/thrust/system/cuda/detail/remove.h index 700c95f23c..207a58a743 100644 --- a/thrust/system/cuda/detail/remove.h +++ b/thrust/system/cuda/detail/remove.h @@ -30,8 +30,7 @@ #if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { // in-place @@ -130,5 +129,5 @@ remove_copy(execution_policy &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/replace.h b/thrust/system/cuda/detail/replace.h index 3bd685108f..dc1542a083 100644 --- a/thrust/system/cuda/detail/replace.h +++ b/thrust/system/cuda/detail/replace.h @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __replace @@ -209,5 +208,5 @@ replace_copy(execution_policy &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/reverse.h b/thrust/system/cuda/detail/reverse.h index 43cdf77fd1..374e317269 100644 --- a/thrust/system/cuda/detail/reverse.h +++ b/thrust/system/cuda/detail/reverse.h @@ -30,8 +30,7 @@ #if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template @@ -48,7 +47,7 @@ reverse(execution_policy &policy, ItemsIt last); } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include #include @@ -56,8 +55,7 @@ reverse(execution_policy &policy, #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/scan.h b/thrust/system/cuda/detail/scan.h index ebfc61546a..add8c580aa 100644 --- a/thrust/system/cuda/detail/scan.h +++ b/thrust/system/cuda/detail/scan.h @@ -38,8 +38,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace detail @@ -58,16 +57,16 @@ OutputIt inclusive_scan_n_impl(thrust::cuda_cub::execution_policy &poli OutputIt result, ScanOp scan_op) { - using Dispatch32 = cub::DispatchScan; - using Dispatch64 = cub::DispatchScan; + using Dispatch32 = CUB_NS_QUALIFIER::DispatchScan; + using Dispatch64 = CUB_NS_QUALIFIER::DispatchScan; cudaStream_t stream = thrust::cuda_cub::stream(policy); cudaError_t status; @@ -84,7 +83,7 @@ OutputIt inclusive_scan_n_impl(thrust::cuda_cub::execution_policy &poli first, result, scan_op, - cub::NullType{}, + CUB_NS_QUALIFIER::NullType{}, num_items_fixed, stream, THRUST_DEBUG_SYNC_FLAG)); @@ -108,7 +107,7 @@ OutputIt inclusive_scan_n_impl(thrust::cuda_cub::execution_policy &poli first, result, scan_op, - cub::NullType{}, + CUB_NS_QUALIFIER::NullType{}, num_items_fixed, stream, THRUST_DEBUG_SYNC_FLAG)); @@ -136,16 +135,16 @@ OutputIt exclusive_scan_n_impl(thrust::cuda_cub::execution_policy &poli InitValueT init, ScanOp scan_op) { - using Dispatch32 = cub::DispatchScan; - using Dispatch64 = cub::DispatchScan; + using Dispatch32 = CUB_NS_QUALIFIER::DispatchScan; + using Dispatch64 = CUB_NS_QUALIFIER::DispatchScan; cudaStream_t stream = thrust::cuda_cub::stream(policy); cudaError_t status; @@ -361,7 +360,7 @@ OutputIt exclusive_scan(thrust::cuda_cub::execution_policy &policy, }; } // namespace cuda_cub -} // namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/cuda/detail/scan_by_key.h b/thrust/system/cuda/detail/scan_by_key.h index fe4b321c0f..2378ed4842 100644 --- a/thrust/system/cuda/detail/scan_by_key.h +++ b/thrust/system/cuda/detail/scan_by_key.h @@ -40,8 +40,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __scan_by_key { @@ -49,10 +48,10 @@ namespace __scan_by_key { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS, + CUB_NS_QUALIFIER::BlockStoreAlgorithm _STORE_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_STORE_DIRECT> struct PtxPolicy { enum @@ -62,10 +61,10 @@ namespace __scan_by_key { ITEMS_PER_TILE = BLOCK_THREADS * ITEMS_PER_THREAD, }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; - static const cub::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; }; // struct PtxPolicy template @@ -94,10 +93,10 @@ namespace __scan_by_key { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm30 @@ -124,10 +123,10 @@ namespace __scan_by_key { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm35 @@ -154,10 +153,10 @@ namespace __scan_by_key { typedef PtxPolicy<256, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; // Tuning sm52 @@ -176,11 +175,11 @@ namespace __scan_by_key { typedef T value_type; typedef Size size_type; - typedef cub::KeyValuePair size_value_pair_t; - typedef cub::KeyValuePair key_value_pair_t; + typedef CUB_NS_QUALIFIER::KeyValuePair size_value_pair_t; + typedef CUB_NS_QUALIFIER::KeyValuePair key_value_pair_t; - typedef cub::ReduceByKeyScanTileState ScanTileState; - typedef cub::ReduceBySegmentOp ReduceBySegmentOp; + typedef CUB_NS_QUALIFIER::ReduceByKeyScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ReduceBySegmentOp ReduceBySegmentOp; template struct PtxPlan : Tuning::type @@ -197,19 +196,19 @@ namespace __scan_by_key { ValuesOutputIt, value_type>::type BlockStoreValues; - typedef cub::BlockDiscontinuity BlockDiscontinuityKeys; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan inequality_op; + CUB_NS_QUALIFIER::InequalityWrapper inequality_op; ReduceBySegmentOp scan_op; @@ -672,7 +671,7 @@ namespace __scan_by_key { AgentPlan init_plan = init_agent::get_plan(); int tile_size = scan_by_key_plan.items_per_tile; - size_t num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t vshmem_size = core::vshmem_size(scan_by_key_plan.shared_memory_size, num_tiles); @@ -682,7 +681,7 @@ namespace __scan_by_key { CUDA_CUB_RET_IF_FAIL(status); void *allocations[2] = {NULL, NULL}; - status = cub::AliasTemporaries(d_temp_storage, + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes); @@ -999,7 +998,7 @@ exclusive_scan_by_key(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/cuda/detail/scatter.h b/thrust/system/cuda/detail/scatter.h index 3ba0a4b743..cbeee204ae 100644 --- a/thrust/system/cuda/detail/scatter.h +++ b/thrust/system/cuda/detail/scatter.h @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template & policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/set_operations.h b/thrust/system/cuda/detail/set_operations.h index a86289de21..8b94e75bbd 100644 --- a/thrust/system/cuda/detail/set_operations.h +++ b/thrust/system/cuda/detail/set_operations.h @@ -42,8 +42,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -202,9 +201,9 @@ namespace __set_operations { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> struct PtxPolicy { enum @@ -214,9 +213,9 @@ namespace __set_operations { ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD - 1 }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; }; // PtxPolicy template @@ -245,9 +244,9 @@ namespace __set_operations { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // tuning sm30 @@ -272,9 +271,9 @@ namespace __set_operations { typedef PtxPolicy<256, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // tuning sm52 @@ -299,9 +298,9 @@ namespace __set_operations { typedef PtxPolicy<512, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // tuning sm60 @@ -325,7 +324,7 @@ namespace __set_operations { typedef key1_type key_type; typedef value1_type value_type; - typedef cub::ScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ScanTileState ScanTileState; template struct PtxPlan : Tuning::type @@ -342,13 +341,13 @@ namespace __set_operations { typedef typename core::BlockLoad::type BlockLoadValues1; typedef typename core::BlockLoad::type BlockLoadValues2; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/sort.h b/thrust/system/cuda/detail/sort.h index 4a1be80cd1..07ae32c8de 100644 --- a/thrust/system/cuda/detail/sort.h +++ b/thrust/system/cuda/detail/sort.h @@ -46,8 +46,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __merge_sort { @@ -131,9 +130,9 @@ namespace __merge_sort { template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockStoreAlgorithm _STORE_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_STORE_DIRECT> struct PtxPolicy { enum @@ -143,9 +142,9 @@ namespace __merge_sort { ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD, }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockStoreAlgorithm STORE_ALGORITHM = _STORE_ALGORITHM; }; // PtxPolicy @@ -165,9 +164,9 @@ namespace __merge_sort { typedef PtxPolicy<256, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; @@ -184,9 +183,9 @@ namespace __merge_sort { typedef PtxPolicy<512, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; @@ -203,9 +202,9 @@ namespace __merge_sort { typedef PtxPolicy<256, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; @@ -220,9 +219,9 @@ namespace __merge_sort { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_STORE_WARP_TRANSPOSE> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_STORE_WARP_TRANSPOSE> type; }; @@ -1334,13 +1333,13 @@ namespace __radix_sort { THRUST_RUNTIME_FUNCTION static cudaError_t doit(void* d_temp_storage, size_t& temp_storage_bytes, - cub::DoubleBuffer& keys_buffer, - cub::DoubleBuffer& /*items_buffer*/, + CUB_NS_QUALIFIER::DoubleBuffer& keys_buffer, + CUB_NS_QUALIFIER::DoubleBuffer& /*items_buffer*/, Size count, cudaStream_t stream, bool debug_sync) { - return cub::DeviceRadixSort::SortKeys(d_temp_storage, + return CUB_NS_QUALIFIER::DeviceRadixSort::SortKeys(d_temp_storage, temp_storage_bytes, keys_buffer, static_cast(count), @@ -1359,13 +1358,13 @@ namespace __radix_sort { THRUST_RUNTIME_FUNCTION static cudaError_t doit(void* d_temp_storage, size_t& temp_storage_bytes, - cub::DoubleBuffer& keys_buffer, - cub::DoubleBuffer& /*items_buffer*/, + CUB_NS_QUALIFIER::DoubleBuffer& keys_buffer, + CUB_NS_QUALIFIER::DoubleBuffer& /*items_buffer*/, Size count, cudaStream_t stream, bool debug_sync) { - return cub::DeviceRadixSort::SortKeysDescending(d_temp_storage, + return CUB_NS_QUALIFIER::DeviceRadixSort::SortKeysDescending(d_temp_storage, temp_storage_bytes, keys_buffer, static_cast(count), @@ -1384,13 +1383,13 @@ namespace __radix_sort { THRUST_RUNTIME_FUNCTION static cudaError_t doit(void* d_temp_storage, size_t& temp_storage_bytes, - cub::DoubleBuffer& keys_buffer, - cub::DoubleBuffer& items_buffer, + CUB_NS_QUALIFIER::DoubleBuffer& keys_buffer, + CUB_NS_QUALIFIER::DoubleBuffer& items_buffer, Size count, cudaStream_t stream, bool debug_sync) { - return cub::DeviceRadixSort::SortPairs(d_temp_storage, + return CUB_NS_QUALIFIER::DeviceRadixSort::SortPairs(d_temp_storage, temp_storage_bytes, keys_buffer, items_buffer, @@ -1410,13 +1409,13 @@ namespace __radix_sort { THRUST_RUNTIME_FUNCTION static cudaError_t doit(void* d_temp_storage, size_t& temp_storage_bytes, - cub::DoubleBuffer& keys_buffer, - cub::DoubleBuffer& items_buffer, + CUB_NS_QUALIFIER::DoubleBuffer& keys_buffer, + CUB_NS_QUALIFIER::DoubleBuffer& items_buffer, Size count, cudaStream_t stream, bool debug_sync) { - return cub::DeviceRadixSort::SortPairsDescending(d_temp_storage, + return CUB_NS_QUALIFIER::DeviceRadixSort::SortPairsDescending(d_temp_storage, temp_storage_bytes, keys_buffer, items_buffer, @@ -1445,8 +1444,8 @@ namespace __radix_sort { cudaStream_t stream = cuda_cub::stream(policy); bool debug_sync = THRUST_DEBUG_SYNC_FLAG; - cub::DoubleBuffer keys_buffer(keys, NULL); - cub::DoubleBuffer items_buffer(items, NULL); + CUB_NS_QUALIFIER::DoubleBuffer keys_buffer(keys, NULL); + CUB_NS_QUALIFIER::DoubleBuffer items_buffer(items, NULL); Size keys_count = count; Size items_count = SORT_ITEMS::value ? count : 0; @@ -1755,5 +1754,5 @@ stable_sort_by_key( } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/swap_ranges.h b/thrust/system/cuda/detail/swap_ranges.h index ba3b47d9b9..225ebeb20e 100644 --- a/thrust/system/cuda/detail/swap_ranges.h +++ b/thrust/system/cuda/detail/swap_ranges.h @@ -35,8 +35,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -103,5 +102,5 @@ swap_ranges(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/tabulate.h b/thrust/system/cuda/detail/tabulate.h index 70b2720d9a..bc8a974451 100644 --- a/thrust/system/cuda/detail/tabulate.h +++ b/thrust/system/cuda/detail/tabulate.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { namespace __tabulate { @@ -84,5 +83,5 @@ tabulate(execution_policy& policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/terminate.h b/thrust/system/cuda/detail/terminate.h index d14bed2ab3..226c9d5ac2 100644 --- a/thrust/system/cuda/detail/terminate.h +++ b/thrust/system/cuda/detail/terminate.h @@ -31,8 +31,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda @@ -59,5 +58,5 @@ void terminate_with_message(const char* message) } // end detail } // end cuda } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/detail/transform.h b/thrust/system/cuda/detail/transform.h index 053fe9095a..e44b605d0c 100644 --- a/thrust/system/cuda/detail/transform.h +++ b/thrust/system/cuda/detail/transform.h @@ -35,8 +35,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -422,5 +421,5 @@ transform(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/transform_reduce.h b/thrust/system/cuda/detail/transform_reduce.h index e9a193f242..be48f6f531 100644 --- a/thrust/system/cuda/detail/transform_reduce.h +++ b/thrust/system/cuda/detail/transform_reduce.h @@ -32,8 +32,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { template &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/transform_scan.h b/thrust/system/cuda/detail/transform_scan.h index d8814a9edd..38bc100da5 100644 --- a/thrust/system/cuda/detail/transform_scan.h +++ b/thrust/system/cuda/detail/transform_scan.h @@ -32,8 +32,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -109,5 +108,5 @@ transform_exclusive_scan(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/uninitialized_copy.h b/thrust/system/cuda/detail/uninitialized_copy.h index 8d916e33ba..0433dea9f4 100644 --- a/thrust/system/cuda/detail/uninitialized_copy.h +++ b/thrust/system/cuda/detail/uninitialized_copy.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -112,5 +111,5 @@ uninitialized_copy(execution_policy& policy, } // namespace cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/uninitialized_fill.h b/thrust/system/cuda/detail/uninitialized_fill.h index a8f5fa8097..250d4fc36d 100644 --- a/thrust/system/cuda/detail/uninitialized_fill.h +++ b/thrust/system/cuda/detail/uninitialized_fill.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -110,5 +109,5 @@ uninitialized_fill(execution_policy& policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #endif diff --git a/thrust/system/cuda/detail/unique.h b/thrust/system/cuda/detail/unique.h index 5dfcc7aecc..d843f38f42 100644 --- a/thrust/system/cuda/detail/unique.h +++ b/thrust/system/cuda/detail/unique.h @@ -44,8 +44,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> struct PtxPolicy { enum @@ -89,9 +88,9 @@ namespace __unique { ITEMS_PER_THREAD = _ITEMS_PER_THREAD, ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD, }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; }; // struct PtxPolicy template @@ -128,9 +127,9 @@ namespace __unique { typedef PtxPolicy<64, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning for sm52 @@ -149,9 +148,9 @@ namespace __unique { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning for sm35 @@ -169,9 +168,9 @@ namespace __unique { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning for sm30 @@ -184,7 +183,7 @@ namespace __unique { { typedef typename iterator_traits::value_type item_type; - typedef cub::ScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ScanTileState ScanTileState; template struct PtxPlan : Tuning::type @@ -195,19 +194,19 @@ namespace __unique { typedef typename core::BlockLoad::type BlockLoadItems; - typedef cub::BlockDiscontinuity BlockDiscontinuityItems; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan predicate; + CUB_NS_QUALIFIER::InequalityWrapper predicate; Size num_items; //--------------------------------------------------------------------- @@ -393,7 +392,7 @@ namespace __unique { { TilePrefixCallback prefix_cb(tile_state, temp_storage.scan_storage.prefix, - cub::Sum(), + CUB_NS_QUALIFIER::Sum(), tile_idx); BlockScan(temp_storage.scan_storage.scan) .ExclusiveSum(selection_flags, @@ -580,7 +579,7 @@ namespace __unique { int tile_size = unique_plan.items_per_tile; - size_t num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t vshmem_size = core::vshmem_size(unique_plan.shared_memory_size, num_tiles); @@ -592,7 +591,7 @@ namespace __unique { void *allocations[2] = {NULL, NULL}; // - status = cub::AliasTemporaries(d_temp_storage, + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes); @@ -795,7 +794,7 @@ unique(execution_policy &policy, } } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END // #include diff --git a/thrust/system/cuda/detail/unique_by_key.h b/thrust/system/cuda/detail/unique_by_key.h index 605e88cfc3..4e94544715 100644 --- a/thrust/system/cuda/detail/unique_by_key.h +++ b/thrust/system/cuda/detail/unique_by_key.h @@ -46,8 +46,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN template + CUB_NS_QUALIFIER::BlockLoadAlgorithm _LOAD_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_LOAD_DIRECT, + CUB_NS_QUALIFIER::CacheLoadModifier _LOAD_MODIFIER = CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BlockScanAlgorithm _SCAN_ALGORITHM = CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> struct PtxPolicy { enum @@ -93,9 +92,9 @@ namespace __unique_by_key { ITEMS_PER_THREAD = _ITEMS_PER_THREAD, ITEMS_PER_TILE = _BLOCK_THREADS * _ITEMS_PER_THREAD, }; - static const cub::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; - static const cub::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; - static const cub::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; + static const CUB_NS_QUALIFIER::BlockLoadAlgorithm LOAD_ALGORITHM = _LOAD_ALGORITHM; + static const CUB_NS_QUALIFIER::CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER; + static const CUB_NS_QUALIFIER::BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM; }; // struct PtxPolicy template @@ -133,9 +132,9 @@ namespace __unique_by_key { typedef PtxPolicy<64, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning for sm52 @@ -153,9 +152,9 @@ namespace __unique_by_key { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_LDG, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_LDG, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning for sm35 @@ -173,9 +172,9 @@ namespace __unique_by_key { typedef PtxPolicy<128, ITEMS_PER_THREAD, - cub::BLOCK_LOAD_WARP_TRANSPOSE, - cub::LOAD_DEFAULT, - cub::BLOCK_SCAN_WARP_SCANS> + CUB_NS_QUALIFIER::BLOCK_LOAD_WARP_TRANSPOSE, + CUB_NS_QUALIFIER::LOAD_DEFAULT, + CUB_NS_QUALIFIER::BLOCK_SCAN_WARP_SCANS> type; }; // Tuning for sm30 @@ -191,7 +190,7 @@ namespace __unique_by_key { typedef typename iterator_traits::value_type key_type; typedef typename iterator_traits::value_type value_type; - typedef cub::ScanTileState ScanTileState; + typedef CUB_NS_QUALIFIER::ScanTileState ScanTileState; template struct PtxPlan : Tuning::type @@ -204,19 +203,19 @@ namespace __unique_by_key { typedef typename core::BlockLoad::type BlockLoadKeys; typedef typename core::BlockLoad::type BlockLoadValues; - typedef cub::BlockDiscontinuity BlockDiscontinuityKeys; - typedef cub::TilePrefixCallbackOp TilePrefixCallback; - typedef cub::BlockScan predicate; + CUB_NS_QUALIFIER::InequalityWrapper predicate; Size num_items; //--------------------------------------------------------------------- @@ -443,7 +442,7 @@ namespace __unique_by_key { { TilePrefixCallback prefix_cb(tile_state, temp_storage.scan_storage.prefix, - cub::Sum(), + CUB_NS_QUALIFIER::Sum(), tile_idx); BlockScan(temp_storage.scan_storage.scan) .ExclusiveSum(selection_flags, @@ -662,7 +661,7 @@ namespace __unique_by_key { int tile_size = unique_plan.items_per_tile; - size_t num_tiles = cub::DivideAndRoundUp(num_items, tile_size); + size_t num_tiles = CUB_NS_QUALIFIER::DivideAndRoundUp(num_items, tile_size); size_t vshmem_size = core::vshmem_size(unique_plan.shared_memory_size, num_tiles); @@ -674,7 +673,7 @@ namespace __unique_by_key { void *allocations[2] = {NULL, NULL}; // - status = cub::AliasTemporaries(d_temp_storage, + status = CUB_NS_QUALIFIER::AliasTemporaries(d_temp_storage, temp_storage_bytes, allocations, allocation_sizes); @@ -928,7 +927,7 @@ unique_by_key(execution_policy &policy, } // namespace cuda_cub -} // end namespace thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/system/cuda/detail/util.h b/thrust/system/cuda/detail/util.h index 07ee7d9a1c..47aaec11df 100644 --- a/thrust/system/cuda/detail/util.h +++ b/thrust/system/cuda/detail/util.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace cuda_cub { @@ -586,4 +585,4 @@ struct counting_iterator_t } // cuda_ -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/error.h b/thrust/system/cuda/error.h index dcbadd8551..09a0f0b684 100644 --- a/thrust/system/cuda/error.h +++ b/thrust/system/cuda/error.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -177,7 +176,7 @@ namespace errc = system::cuda::errc; using system::cuda_category; -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/cuda/experimental/pinned_allocator.h b/thrust/system/cuda/experimental/pinned_allocator.h index 62a3663238..e821468fc5 100644 --- a/thrust/system/cuda/experimental/pinned_allocator.h +++ b/thrust/system/cuda/experimental/pinned_allocator.h @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -240,5 +239,5 @@ using thrust::system::cuda::experimental::pinned_allocator; } // end cuda -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/future.h b/thrust/system/cuda/future.h index e42437e93c..79bfc9134d 100644 --- a/thrust/system/cuda/future.h +++ b/thrust/system/cuda/future.h @@ -13,8 +13,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace cuda { @@ -66,7 +65,7 @@ unique_eager_future_type( thrust::cuda::execution_policy const& ) noexcept; -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/cuda/memory.h b/thrust/system/cuda/memory.h index 4d94a08850..eb8020adb9 100644 --- a/thrust/system/cuda/memory.h +++ b/thrust/system/cuda/memory.h @@ -27,7 +27,8 @@ #include #include -namespace thrust { namespace cuda_cub +THRUST_NAMESPACE_BEGIN +namespace cuda_cub { /*! Allocates an area of memory available to Thrust's cuda system. @@ -102,7 +103,7 @@ using thrust::cuda_cub::allocator; using thrust::cuda_cub::universal_allocator; } // namespace cuda -} // namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/cuda/memory_resource.h b/thrust/system/cuda/memory_resource.h index a8558d061b..00db724cf0 100644 --- a/thrust/system/cuda/memory_resource.h +++ b/thrust/system/cuda/memory_resource.h @@ -29,8 +29,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -121,5 +120,5 @@ using thrust::system::cuda::universal_memory_resource; using thrust::system::cuda::universal_host_pinned_memory_resource; } -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/pointer.h b/thrust/system/cuda/pointer.h index c586eb9dc4..a5bccf03fa 100644 --- a/thrust/system/cuda/pointer.h +++ b/thrust/system/cuda/pointer.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace cuda_cub +THRUST_NAMESPACE_BEGIN +namespace cuda_cub { /*! \p cuda::pointer stores a pointer to an object allocated in memory @@ -132,5 +133,5 @@ using thrust::cuda_cub::universal_pointer; using thrust::cuda_cub::reference; } // namespace cuda -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/cuda/vector.h b/thrust/system/cuda/vector.h index 7a90a07fb2..fafc7bf17e 100644 --- a/thrust/system/cuda/vector.h +++ b/thrust/system/cuda/vector.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace cuda_cub +THRUST_NAMESPACE_BEGIN +namespace cuda_cub { /*! \p cuda::vector is a container that supports random access to elements, @@ -84,5 +85,5 @@ using thrust::cuda_cub::vector; using thrust::cuda_cub::universal_vector; } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/bad_alloc.h b/thrust/system/detail/bad_alloc.h index 461704fd6b..e5d71dde89 100644 --- a/thrust/system/detail/bad_alloc.h +++ b/thrust/system/detail/bad_alloc.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -53,5 +52,5 @@ class bad_alloc } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/errno.h b/thrust/system/detail/errno.h index 78aec2acea..69cb2bd980 100644 --- a/thrust/system/detail/errno.h +++ b/thrust/system/detail/errno.h @@ -24,8 +24,7 @@ // pollute the global namespace. These identifiers are in lowercase to avoid // colliding with the real macros in errno.h. -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -116,5 +115,5 @@ static const int emlink = 9979; } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/error_category.inl b/thrust/system/detail/error_category.inl index 4602b0f300..36e56ee00a 100644 --- a/thrust/system/detail/error_category.inl +++ b/thrust/system/detail/error_category.inl @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -232,5 +231,5 @@ const error_category &system_category(void) } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/error_code.inl b/thrust/system/detail/error_code.inl index 6631f486fe..62acf8d54c 100644 --- a/thrust/system/detail/error_code.inl +++ b/thrust/system/detail/error_code.inl @@ -19,8 +19,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -193,5 +192,5 @@ bool operator!=(const error_condition &lhs, const error_condition &rhs) } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/error_condition.inl b/thrust/system/detail/error_condition.inl index 9dc493bcc9..b25eda7e9b 100644 --- a/thrust/system/detail/error_condition.inl +++ b/thrust/system/detail/error_condition.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -129,5 +128,5 @@ bool operator<(const error_condition &lhs, } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/adjacent_difference.h b/thrust/system/detail/generic/adjacent_difference.h index 6e4caaa88b..43592e15b0 100644 --- a/thrust/system/detail/generic/adjacent_difference.h +++ b/thrust/system/detail/generic/adjacent_difference.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -52,7 +51,7 @@ OutputIterator adjacent_difference(thrust::execution_policy &exec } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/adjacent_difference.inl b/thrust/system/detail/generic/adjacent_difference.inl index ad4ad1cd4c..7a16a7a04e 100644 --- a/thrust/system/detail/generic/adjacent_difference.inl +++ b/thrust/system/detail/generic/adjacent_difference.inl @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -77,5 +76,5 @@ OutputIterator adjacent_difference(thrust::execution_policy &exec } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/advance.h b/thrust/system/detail/generic/advance.h index f9cab587b3..4d6562e00f 100644 --- a/thrust/system/detail/generic/advance.h +++ b/thrust/system/detail/generic/advance.h @@ -19,8 +19,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -35,7 +34,7 @@ void advance(InputIterator& i, Distance n); } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/advance.inl b/thrust/system/detail/generic/advance.inl index ae98d596bc..9cd77ea37c 100644 --- a/thrust/system/detail/generic/advance.inl +++ b/thrust/system/detail/generic/advance.inl @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -63,5 +62,5 @@ void advance(InputIterator& i, Distance n) } // end namespace detail } // end namespace generic } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/binary_search.h b/thrust/system/detail/generic/binary_search.h index 8cd85c63f3..6603f6c302 100644 --- a/thrust/system/detail/generic/binary_search.h +++ b/thrust/system/detail/generic/binary_search.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -168,7 +167,7 @@ equal_range(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/binary_search.inl b/thrust/system/detail/generic/binary_search.inl index b7c72f1cb3..3807b79e76 100644 --- a/thrust/system/detail/generic/binary_search.inl +++ b/thrust/system/detail/generic/binary_search.inl @@ -36,8 +36,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -398,5 +397,5 @@ equal_range(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/copy.h b/thrust/system/detail/generic/copy.h index e22535618e..36ac71899d 100644 --- a/thrust/system/detail/generic/copy.h +++ b/thrust/system/detail/generic/copy.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -53,7 +52,7 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/copy.inl b/thrust/system/detail/generic/copy.inl index 9763a06823..34d66baa6b 100644 --- a/thrust/system/detail/generic/copy.inl +++ b/thrust/system/detail/generic/copy.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -77,5 +76,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/copy_if.h b/thrust/system/detail/generic/copy_if.h index 6e3fb73a67..6a13edfdaf 100644 --- a/thrust/system/detail/generic/copy_if.h +++ b/thrust/system/detail/generic/copy_if.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -58,7 +57,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/copy_if.inl b/thrust/system/detail/generic/copy_if.inl index 4bdafe382d..5a6edd72e1 100644 --- a/thrust/system/detail/generic/copy_if.inl +++ b/thrust/system/detail/generic/copy_if.inl @@ -32,8 +32,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -157,5 +156,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/count.h b/thrust/system/detail/generic/count.h index 218369e386..295d36e6b9 100644 --- a/thrust/system/detail/generic/count.h +++ b/thrust/system/detail/generic/count.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -45,7 +44,7 @@ count_if(thrust::execution_policy &exec, InputIterator first, Inp } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/count.inl b/thrust/system/detail/generic/count.inl index f12f0122e8..fb8cf981b3 100644 --- a/thrust/system/detail/generic/count.inl +++ b/thrust/system/detail/generic/count.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -77,5 +76,5 @@ count_if(thrust::execution_policy &exec, InputIterator first, Inp } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/distance.h b/thrust/system/detail/generic/distance.h index 03b0fb5564..4627376b57 100644 --- a/thrust/system/detail/generic/distance.h +++ b/thrust/system/detail/generic/distance.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -37,7 +36,7 @@ inline __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/distance.inl b/thrust/system/detail/generic/distance.inl index 930d0844cb..66ad64bb20 100644 --- a/thrust/system/detail/generic/distance.inl +++ b/thrust/system/detail/generic/distance.inl @@ -18,8 +18,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -75,5 +74,5 @@ inline __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/equal.h b/thrust/system/detail/generic/equal.h index 8962b1bd14..4afd88d001 100644 --- a/thrust/system/detail/generic/equal.h +++ b/thrust/system/detail/generic/equal.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -42,7 +41,7 @@ bool equal(thrust::execution_policy &exec, InputIterator1 first1, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/equal.inl b/thrust/system/detail/generic/equal.inl index 7c9dec4bc4..7828cb1ead 100644 --- a/thrust/system/detail/generic/equal.inl +++ b/thrust/system/detail/generic/equal.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -54,5 +53,5 @@ bool equal(thrust::execution_policy &exec, InputIterator1 first1, } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/extrema.h b/thrust/system/detail/generic/extrema.h index a3ee818897..e3b447958e 100644 --- a/thrust/system/detail/generic/extrema.h +++ b/thrust/system/detail/generic/extrema.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -83,7 +82,7 @@ thrust::pair minmax_element(thrust::execution_p } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/extrema.inl b/thrust/system/detail/generic/extrema.inl index 22183db9a3..744d137de1 100644 --- a/thrust/system/detail/generic/extrema.inl +++ b/thrust/system/detail/generic/extrema.inl @@ -33,8 +33,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -259,5 +258,5 @@ thrust::pair minmax_element(thrust::execution_p } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/fill.h b/thrust/system/detail/generic/fill.h index 6c4f2ed4e7..d7eea2838a 100644 --- a/thrust/system/detail/generic/fill.h +++ b/thrust/system/detail/generic/fill.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -56,5 +55,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/find.h b/thrust/system/detail/generic/find.h index 00e11e53c6..6db441d02f 100644 --- a/thrust/system/detail/generic/find.h +++ b/thrust/system/detail/generic/find.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -57,7 +56,7 @@ InputIterator find_if_not(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/find.inl b/thrust/system/detail/generic/find.inl index a7126825d9..e1c2953434 100644 --- a/thrust/system/detail/generic/find.inl +++ b/thrust/system/detail/generic/find.inl @@ -28,8 +28,7 @@ // Contributed by Erich Elsen -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -146,5 +145,5 @@ InputIterator find_if_not(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/for_each.h b/thrust/system/detail/generic/for_each.h index c4add43052..3c2ec12cd2 100644 --- a/thrust/system/detail/generic/for_each.h +++ b/thrust/system/detail/generic/for_each.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -74,5 +73,5 @@ InputIterator for_each_n(thrust::execution_policy &, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/gather.h b/thrust/system/detail/generic/gather.h index d587572f0b..5b6b418311 100644 --- a/thrust/system/detail/generic/gather.h +++ b/thrust/system/detail/generic/gather.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -75,7 +74,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/gather.inl b/thrust/system/detail/generic/gather.inl index 4f4289ecb2..218ca85772 100644 --- a/thrust/system/detail/generic/gather.inl +++ b/thrust/system/detail/generic/gather.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -103,5 +102,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/generate.h b/thrust/system/detail/generic/generate.h index edc2cc5eb3..a9846c5bed 100644 --- a/thrust/system/detail/generic/generate.h +++ b/thrust/system/detail/generic/generate.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -51,7 +50,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/generate.inl b/thrust/system/detail/generic/generate.inl index 9ca319b999..dd750dd514 100644 --- a/thrust/system/detail/generic/generate.inl +++ b/thrust/system/detail/generic/generate.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -95,5 +94,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/inner_product.h b/thrust/system/detail/generic/inner_product.h index 71e1a92705..62d10d31f5 100644 --- a/thrust/system/detail/generic/inner_product.h +++ b/thrust/system/detail/generic/inner_product.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -53,7 +52,7 @@ OutputType inner_product(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/inner_product.inl b/thrust/system/detail/generic/inner_product.inl index 0a50386be8..2b1026b461 100644 --- a/thrust/system/detail/generic/inner_product.inl +++ b/thrust/system/detail/generic/inner_product.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -68,5 +67,5 @@ OutputType inner_product(thrust::execution_policy &exec, } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/logical.h b/thrust/system/detail/generic/logical.h index 702dbad852..e261154e24 100644 --- a/thrust/system/detail/generic/logical.h +++ b/thrust/system/detail/generic/logical.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -59,5 +58,5 @@ bool none_of(thrust::execution_policy &exec, InputIterator firs } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/memory.h b/thrust/system/detail/generic/memory.h index 344b3673d1..675cc73023 100644 --- a/thrust/system/detail/generic/memory.h +++ b/thrust/system/detail/generic/memory.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -65,7 +64,7 @@ void iter_swap(thrust::execution_policy&, Pointer1, Pointer2); } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/memory.inl b/thrust/system/detail/generic/memory.inl index eadf39ae96..c873363f32 100644 --- a/thrust/system/detail/generic/memory.inl +++ b/thrust/system/detail/generic/memory.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -100,5 +99,5 @@ void iter_swap(thrust::execution_policy &, Pointer1, Pointer2) } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/merge.h b/thrust/system/detail/generic/merge.h index d80906e3d3..6e82464074 100644 --- a/thrust/system/detail/generic/merge.h +++ b/thrust/system/detail/generic/merge.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -85,7 +84,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/merge.inl b/thrust/system/detail/generic/merge.inl index 2938e8c923..03b77e6235 100644 --- a/thrust/system/detail/generic/merge.inl +++ b/thrust/system/detail/generic/merge.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -127,5 +126,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/mismatch.h b/thrust/system/detail/generic/mismatch.h index 50e9f678b1..4a71cd3441 100644 --- a/thrust/system/detail/generic/mismatch.h +++ b/thrust/system/detail/generic/mismatch.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -52,7 +51,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/mismatch.inl b/thrust/system/detail/generic/mismatch.inl index 8348374a5a..5a60781375 100644 --- a/thrust/system/detail/generic/mismatch.inl +++ b/thrust/system/detail/generic/mismatch.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -70,5 +69,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/partition.h b/thrust/system/detail/generic/partition.h index fdd158c4cc..113d6ecbc3 100644 --- a/thrust/system/detail/generic/partition.h +++ b/thrust/system/detail/generic/partition.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -164,7 +163,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/partition.inl b/thrust/system/detail/generic/partition.inl index 73a8a286ed..32d45727d2 100644 --- a/thrust/system/detail/generic/partition.inl +++ b/thrust/system/detail/generic/partition.inl @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -244,5 +243,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/per_device_resource.h b/thrust/system/detail/generic/per_device_resource.h index 9378940f3a..606f91f365 100644 --- a/thrust/system/detail/generic/per_device_resource.h +++ b/thrust/system/detail/generic/per_device_resource.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -43,5 +42,5 @@ MR * get_per_device_resource(thrust::detail::execution_policy_base #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -53,7 +52,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/reduce.inl b/thrust/system/detail/generic/reduce.inl index b866e86dc4..f5df83c293 100644 --- a/thrust/system/detail/generic/reduce.inl +++ b/thrust/system/detail/generic/reduce.inl @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -75,5 +74,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/reduce_by_key.h b/thrust/system/detail/generic/reduce_by_key.h index aaa5959a42..8ba47e11f0 100644 --- a/thrust/system/detail/generic/reduce_by_key.h +++ b/thrust/system/detail/generic/reduce_by_key.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -83,7 +82,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/reduce_by_key.inl b/thrust/system/detail/generic/reduce_by_key.inl index 86640ea9f8..37d55e6505 100644 --- a/thrust/system/detail/generic/reduce_by_key.inl +++ b/thrust/system/detail/generic/reduce_by_key.inl @@ -35,8 +35,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -193,5 +192,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/remove.h b/thrust/system/detail/generic/remove.h index 343f643e9d..37354ef805 100644 --- a/thrust/system/detail/generic/remove.h +++ b/thrust/system/detail/generic/remove.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -107,7 +106,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/remove.inl b/thrust/system/detail/generic/remove.inl index 6cb5a694ba..0ca81b143d 100644 --- a/thrust/system/detail/generic/remove.inl +++ b/thrust/system/detail/generic/remove.inl @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -146,5 +145,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/replace.h b/thrust/system/detail/generic/replace.h index 6167f711ad..0821d6c07d 100644 --- a/thrust/system/detail/generic/replace.h +++ b/thrust/system/detail/generic/replace.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -92,7 +91,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/replace.inl b/thrust/system/detail/generic/replace.inl index eea70ccd17..711c5fd241 100644 --- a/thrust/system/detail/generic/replace.inl +++ b/thrust/system/detail/generic/replace.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -174,5 +173,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/reverse.h b/thrust/system/detail/generic/reverse.h index 11421d41b4..65c77ae750 100644 --- a/thrust/system/detail/generic/reverse.h +++ b/thrust/system/detail/generic/reverse.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -50,7 +49,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/reverse.inl b/thrust/system/detail/generic/reverse.inl index b77c75b6fc..b6909a4bac 100644 --- a/thrust/system/detail/generic/reverse.inl +++ b/thrust/system/detail/generic/reverse.inl @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -70,6 +69,6 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/scalar/binary_search.h b/thrust/system/detail/generic/scalar/binary_search.h index 373b59a606..3e019c2233 100644 --- a/thrust/system/detail/generic/scalar/binary_search.h +++ b/thrust/system/detail/generic/scalar/binary_search.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -79,7 +78,7 @@ bool binary_search(RandomAccessIterator first, RandomAccessIterator last, const } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/scalar/binary_search.inl b/thrust/system/detail/generic/scalar/binary_search.inl index 83b5f59f89..61c71fba4d 100644 --- a/thrust/system/detail/generic/scalar/binary_search.inl +++ b/thrust/system/detail/generic/scalar/binary_search.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -153,6 +152,6 @@ bool binary_search(RandomAccessIterator first, RandomAccessIterator last, const } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/scan.h b/thrust/system/detail/generic/scan.h index c32b0f2b9f..476441ab6f 100644 --- a/thrust/system/detail/generic/scan.h +++ b/thrust/system/detail/generic/scan.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -93,7 +92,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/scan.inl b/thrust/system/detail/generic/scan.inl index 83d272c3e9..45a2aadd08 100644 --- a/thrust/system/detail/generic/scan.inl +++ b/thrust/system/detail/generic/scan.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -124,5 +123,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/scan_by_key.h b/thrust/system/detail/generic/scan_by_key.h index 3c2ea7931b..9e38ac9339 100644 --- a/thrust/system/detail/generic/scan_by_key.h +++ b/thrust/system/detail/generic/scan_by_key.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -138,7 +137,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/scan_by_key.inl b/thrust/system/detail/generic/scan_by_key.inl index cb05ea0073..338e863e01 100644 --- a/thrust/system/detail/generic/scan_by_key.inl +++ b/thrust/system/detail/generic/scan_by_key.inl @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -241,5 +240,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/scatter.h b/thrust/system/detail/generic/scatter.h index 4a65a4cc01..6bb7949efa 100644 --- a/thrust/system/detail/generic/scatter.h +++ b/thrust/system/detail/generic/scatter.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -75,7 +74,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/scatter.inl b/thrust/system/detail/generic/scatter.inl index 7a1f522980..9062d46849 100644 --- a/thrust/system/detail/generic/scatter.inl +++ b/thrust/system/detail/generic/scatter.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -92,5 +91,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/select_system.h b/thrust/system/detail/generic/select_system.h index 3b5d775036..7619b80e5a 100644 --- a/thrust/system/detail/generic/select_system.h +++ b/thrust/system/detail/generic/select_system.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -120,6 +119,6 @@ thrust::device_system_tag select_system(thrust::any_system_tag); } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/select_system.inl b/thrust/system/detail/generic/select_system.inl index fbe3094bed..b69d17c450 100644 --- a/thrust/system/detail/generic/select_system.inl +++ b/thrust/system/detail/generic/select_system.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -175,5 +174,5 @@ thrust::device_system_tag select_system(thrust::any_system_tag) } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/select_system_exists.h b/thrust/system/detail/generic/select_system_exists.h index ba8ef8bb7e..29d05781d9 100644 --- a/thrust/system/detail/generic/select_system_exists.h +++ b/thrust/system/detail/generic/select_system_exists.h @@ -23,8 +23,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN // forward declaration of any_system_tag for any_conversion below struct any_system_tag; @@ -164,5 +163,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -58,7 +57,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/sequence.inl b/thrust/system/detail/generic/sequence.inl index 1ffbf98681..711fb5c7ed 100644 --- a/thrust/system/detail/generic/sequence.inl +++ b/thrust/system/detail/generic/sequence.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -88,5 +87,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/set_operations.h b/thrust/system/detail/generic/set_operations.h index 4dbee0ae40..37665d78dd 100644 --- a/thrust/system/detail/generic/set_operations.h +++ b/thrust/system/detail/generic/set_operations.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -313,7 +312,7 @@ thrust::pair } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/set_operations.inl b/thrust/system/detail/generic/set_operations.inl index 6264aff167..4363be5c0d 100644 --- a/thrust/system/detail/generic/set_operations.inl +++ b/thrust/system/detail/generic/set_operations.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -473,5 +472,5 @@ OutputIterator set_union(thrust::execution_policy &, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/shuffle.h b/thrust/system/detail/generic/shuffle.h index a690c11c59..8f8e21afdf 100644 --- a/thrust/system/detail/generic/shuffle.h +++ b/thrust/system/detail/generic/shuffle.h @@ -28,7 +28,7 @@ #include -namespace thrust { +THRUST_NAMESPACE_BEGIN namespace system { namespace detail { namespace generic { @@ -47,7 +47,7 @@ __host__ __device__ void shuffle_copy( } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/shuffle.inl b/thrust/system/detail/generic/shuffle.inl index 45c087ea8c..91b77351de 100644 --- a/thrust/system/detail/generic/shuffle.inl +++ b/thrust/system/detail/generic/shuffle.inl @@ -25,7 +25,7 @@ #include -namespace thrust { +THRUST_NAMESPACE_BEGIN namespace system { namespace detail { namespace generic { @@ -214,4 +214,4 @@ __host__ __device__ void shuffle_copy( } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/sort.h b/thrust/system/detail/generic/sort.h index 9d4ac19981..cd8d455624 100644 --- a/thrust/system/detail/generic/sort.h +++ b/thrust/system/detail/generic/sort.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -148,7 +147,7 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/sort.inl b/thrust/system/detail/generic/sort.inl index 5f0fb7ebf3..632cab435e 100644 --- a/thrust/system/detail/generic/sort.inl +++ b/thrust/system/detail/generic/sort.inl @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -216,5 +215,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/swap_ranges.h b/thrust/system/detail/generic/swap_ranges.h index 78769715c5..edb5acf31f 100644 --- a/thrust/system/detail/generic/swap_ranges.h +++ b/thrust/system/detail/generic/swap_ranges.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -41,7 +40,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/swap_ranges.inl b/thrust/system/detail/generic/swap_ranges.inl index 81977adc23..0afd51c6f4 100644 --- a/thrust/system/detail/generic/swap_ranges.inl +++ b/thrust/system/detail/generic/swap_ranges.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -74,5 +73,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/tabulate.h b/thrust/system/detail/generic/tabulate.h index 5cb75e9281..041093e82e 100644 --- a/thrust/system/detail/generic/tabulate.h +++ b/thrust/system/detail/generic/tabulate.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -43,7 +42,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/tabulate.inl b/thrust/system/detail/generic/tabulate.inl index 1a740d26a8..122819e6e4 100644 --- a/thrust/system/detail/generic/tabulate.inl +++ b/thrust/system/detail/generic/tabulate.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -55,6 +54,6 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/tag.h b/thrust/system/detail/generic/tag.h index 4da1e79ced..48f0947974 100644 --- a/thrust/system/detail/generic/tag.h +++ b/thrust/system/detail/generic/tag.h @@ -23,8 +23,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -44,5 +43,5 @@ struct tag } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/temporary_buffer.h b/thrust/system/detail/generic/temporary_buffer.h index 7cf389ca15..6b7e01ff24 100644 --- a/thrust/system/detail/generic/temporary_buffer.h +++ b/thrust/system/detail/generic/temporary_buffer.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -52,7 +51,7 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/temporary_buffer.inl b/thrust/system/detail/generic/temporary_buffer.inl index 20f33bdaa5..660bc3ee6e 100644 --- a/thrust/system/detail/generic/temporary_buffer.inl +++ b/thrust/system/detail/generic/temporary_buffer.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -81,5 +80,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/transform.h b/thrust/system/detail/generic/transform.h index 1aa2f4993f..30e032696b 100644 --- a/thrust/system/detail/generic/transform.h +++ b/thrust/system/detail/generic/transform.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -100,7 +99,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/transform.inl b/thrust/system/detail/generic/transform.inl index 589eb65c71..16791e298c 100644 --- a/thrust/system/detail/generic/transform.inl +++ b/thrust/system/detail/generic/transform.inl @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -186,5 +185,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/transform_reduce.h b/thrust/system/detail/generic/transform_reduce.h index 23123fa495..af510296e1 100644 --- a/thrust/system/detail/generic/transform_reduce.h +++ b/thrust/system/detail/generic/transform_reduce.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -47,7 +46,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/transform_reduce.inl b/thrust/system/detail/generic/transform_reduce.inl index 7340f8355c..fae504b9fb 100644 --- a/thrust/system/detail/generic/transform_reduce.inl +++ b/thrust/system/detail/generic/transform_reduce.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -52,5 +51,5 @@ __host__ __device__ } // end generic } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/transform_scan.h b/thrust/system/detail/generic/transform_scan.h index 3f81434fc4..05054c965a 100644 --- a/thrust/system/detail/generic/transform_scan.h +++ b/thrust/system/detail/generic/transform_scan.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -62,7 +61,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/transform_scan.inl b/thrust/system/detail/generic/transform_scan.inl index e913317367..68b9031c76 100644 --- a/thrust/system/detail/generic/transform_scan.inl +++ b/thrust/system/detail/generic/transform_scan.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -92,5 +91,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/uninitialized_copy.h b/thrust/system/detail/generic/uninitialized_copy.h index 2d1b0010df..bac5bcf960 100644 --- a/thrust/system/detail/generic/uninitialized_copy.h +++ b/thrust/system/detail/generic/uninitialized_copy.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -51,7 +50,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/uninitialized_copy.inl b/thrust/system/detail/generic/uninitialized_copy.inl index d6babf65c0..3960e127e0 100644 --- a/thrust/system/detail/generic/uninitialized_copy.inl +++ b/thrust/system/detail/generic/uninitialized_copy.inl @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -189,5 +188,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/uninitialized_fill.h b/thrust/system/detail/generic/uninitialized_fill.h index 6acc65d083..4f5404508c 100644 --- a/thrust/system/detail/generic/uninitialized_fill.h +++ b/thrust/system/detail/generic/uninitialized_fill.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -51,7 +50,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/uninitialized_fill.inl b/thrust/system/detail/generic/uninitialized_fill.inl index 0d4cf3f541..1d0e9fbd0b 100644 --- a/thrust/system/detail/generic/uninitialized_fill.inl +++ b/thrust/system/detail/generic/uninitialized_fill.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -130,5 +129,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/unique.h b/thrust/system/detail/generic/unique.h index 04388cbc00..5f008978ff 100644 --- a/thrust/system/detail/generic/unique.h +++ b/thrust/system/detail/generic/unique.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -72,7 +71,7 @@ OutputIterator unique_copy(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/unique.inl b/thrust/system/detail/generic/unique.inl index 4cd3459fd6..35d0162f9d 100644 --- a/thrust/system/detail/generic/unique.inl +++ b/thrust/system/detail/generic/unique.inl @@ -33,8 +33,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -109,5 +108,5 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/generic/unique_by_key.h b/thrust/system/detail/generic/unique_by_key.h index cb03179dee..0ea9e7cc84 100644 --- a/thrust/system/detail/generic/unique_by_key.h +++ b/thrust/system/detail/generic/unique_by_key.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -89,7 +88,7 @@ __host__ __device__ } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/generic/unique_by_key.inl b/thrust/system/detail/generic/unique_by_key.inl index ff8c5b554b..ffcf1dd0c7 100644 --- a/thrust/system/detail/generic/unique_by_key.inl +++ b/thrust/system/detail/generic/unique_by_key.inl @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -136,5 +135,5 @@ unique_by_key_copy(thrust::execution_policy &exec, } // end namespace generic } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/internal/decompose.h b/thrust/system/detail/internal/decompose.h index e949f20248..58af7c5514 100644 --- a/thrust/system/detail/internal/decompose.h +++ b/thrust/system/detail/internal/decompose.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -110,5 +109,5 @@ namespace internal } // end namespace internal } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/adjacent_difference.h b/thrust/system/detail/sequential/adjacent_difference.h index c6b0ee1b24..4a9dad82c9 100644 --- a/thrust/system/detail/sequential/adjacent_difference.h +++ b/thrust/system/detail/sequential/adjacent_difference.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -70,5 +69,5 @@ OutputIterator adjacent_difference(sequential::execution_policy & } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/assign_value.h b/thrust/system/detail/sequential/assign_value.h index 699bcbcd78..0eb145d135 100644 --- a/thrust/system/detail/sequential/assign_value.h +++ b/thrust/system/detail/sequential/assign_value.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -39,5 +38,5 @@ __host__ __device__ } // end sequential } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/binary_search.h b/thrust/system/detail/sequential/binary_search.h index 54534143ec..267c637125 100644 --- a/thrust/system/detail/sequential/binary_search.h +++ b/thrust/system/detail/sequential/binary_search.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -153,5 +152,5 @@ bool binary_search(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/copy.h b/thrust/system/detail/sequential/copy.h index 80853f6700..0dd2cdad5c 100644 --- a/thrust/system/detail/sequential/copy.h +++ b/thrust/system/detail/sequential/copy.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -57,7 +56,7 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/sequential/copy.inl b/thrust/system/detail/sequential/copy.inl index 8027681d0f..4f33ec8d88 100644 --- a/thrust/system/detail/sequential/copy.inl +++ b/thrust/system/detail/sequential/copy.inl @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -141,5 +140,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/copy_backward.h b/thrust/system/detail/sequential/copy_backward.h index e825436b10..d127ac80db 100644 --- a/thrust/system/detail/sequential/copy_backward.h +++ b/thrust/system/detail/sequential/copy_backward.h @@ -18,8 +18,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -50,5 +49,5 @@ BidirectionalIterator2 copy_backward(BidirectionalIterator1 first, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/copy_if.h b/thrust/system/detail/sequential/copy_if.h index bb29ccdebb..3c00956deb 100644 --- a/thrust/system/detail/sequential/copy_if.h +++ b/thrust/system/detail/sequential/copy_if.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -69,5 +68,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/execution_policy.h b/thrust/system/detail/sequential/execution_policy.h index b1f526b196..99d78fc27f 100644 --- a/thrust/system/detail/sequential/execution_policy.h +++ b/thrust/system/detail/sequential/execution_policy.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -72,5 +71,5 @@ THRUST_INLINE_CONSTANT tag seq; } // end sequential } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/extrema.h b/thrust/system/detail/sequential/extrema.h index 7bfa5a17d9..5e5c62da69 100644 --- a/thrust/system/detail/sequential/extrema.h +++ b/thrust/system/detail/sequential/extrema.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -135,5 +134,5 @@ thrust::pair minmax_element(sequential::executi } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/find.h b/thrust/system/detail/sequential/find.h index 5e551b74a6..54c238c715 100644 --- a/thrust/system/detail/sequential/find.h +++ b/thrust/system/detail/sequential/find.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -67,5 +66,5 @@ InputIterator find_if(execution_policy &, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/for_each.h b/thrust/system/detail/sequential/for_each.h index 6e83d18c12..7058c56f28 100644 --- a/thrust/system/detail/sequential/for_each.h +++ b/thrust/system/detail/sequential/for_each.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -91,5 +90,5 @@ InputIterator for_each_n(sequential::execution_policy &, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/general_copy.h b/thrust/system/detail/sequential/general_copy.h index 9546b72e5e..6ea87bbacb 100644 --- a/thrust/system/detail/sequential/general_copy.h +++ b/thrust/system/detail/sequential/general_copy.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -143,5 +142,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/get_value.h b/thrust/system/detail/sequential/get_value.h index 5f3f8eb040..90752d8671 100644 --- a/thrust/system/detail/sequential/get_value.h +++ b/thrust/system/detail/sequential/get_value.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -42,5 +41,5 @@ __host__ __device__ } // end sequential } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/insertion_sort.h b/thrust/system/detail/sequential/insertion_sort.h index f0bb9bc5f3..9acccd8e92 100644 --- a/thrust/system/detail/sequential/insertion_sort.h +++ b/thrust/system/detail/sequential/insertion_sort.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -149,5 +148,5 @@ void insertion_sort_by_key(RandomAccessIterator1 first1, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/iter_swap.h b/thrust/system/detail/sequential/iter_swap.h index 1c8fde6e75..7a5c481fc0 100644 --- a/thrust/system/detail/sequential/iter_swap.h +++ b/thrust/system/detail/sequential/iter_swap.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -43,5 +42,5 @@ __host__ __device__ } // end sequential } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/malloc_and_free.h b/thrust/system/detail/sequential/malloc_and_free.h index 7c545250e3..b250140e08 100644 --- a/thrust/system/detail/sequential/malloc_and_free.h +++ b/thrust/system/detail/sequential/malloc_and_free.h @@ -21,8 +21,7 @@ #include // for malloc & free #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -50,5 +49,5 @@ void free(sequential::execution_policy &, Pointer ptr) } // end sequential } // end detail } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/merge.h b/thrust/system/detail/sequential/merge.h index 6cd314dc7f..a45e18004d 100644 --- a/thrust/system/detail/sequential/merge.h +++ b/thrust/system/detail/sequential/merge.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -74,7 +73,7 @@ thrust::pair } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/sequential/merge.inl b/thrust/system/detail/sequential/merge.inl index ae28ba97d2..7073c6d4a6 100644 --- a/thrust/system/detail/sequential/merge.inl +++ b/thrust/system/detail/sequential/merge.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -149,5 +148,5 @@ thrust::pair } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/partition.h b/thrust/system/detail/sequential/partition.h index 4604fecfa0..43d5b0e237 100644 --- a/thrust/system/detail/sequential/partition.h +++ b/thrust/system/detail/sequential/partition.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -96,7 +95,7 @@ __host__ __device__ if(wrapped_pred(*next)) { // Fully qualify name to disambiguate overloads found via ADL. - ::thrust::system::detail::sequential::iter_swap(first, next); + THRUST_NS_QUALIFIER::system::detail::sequential::iter_swap(first, next); ++first; } } @@ -145,7 +144,7 @@ __host__ __device__ if(wrapped_pred(*stencil_first)) { // Fully qualify name to disambiguate overloads found via ADL. - ::thrust::system::detail::sequential::iter_swap(first, next); + THRUST_NS_QUALIFIER::system::detail::sequential::iter_swap(first, next); ++first; } @@ -337,5 +336,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/reduce.h b/thrust/system/detail/sequential/reduce.h index 55e92acb9a..a532f71b24 100644 --- a/thrust/system/detail/sequential/reduce.h +++ b/thrust/system/detail/sequential/reduce.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -69,5 +68,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/reduce_by_key.h b/thrust/system/detail/sequential/reduce_by_key.h index 6e07413654..ef17ac5b0e 100644 --- a/thrust/system/detail/sequential/reduce_by_key.h +++ b/thrust/system/detail/sequential/reduce_by_key.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -99,5 +98,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/remove.h b/thrust/system/detail/sequential/remove.h index 48de522dfd..df564f15b0 100644 --- a/thrust/system/detail/sequential/remove.h +++ b/thrust/system/detail/sequential/remove.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -198,5 +197,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/scan.h b/thrust/system/detail/sequential/scan.h index 3bffc93d79..c5fce24758 100644 --- a/thrust/system/detail/sequential/scan.h +++ b/thrust/system/detail/sequential/scan.h @@ -29,8 +29,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -118,5 +117,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/scan_by_key.h b/thrust/system/detail/sequential/scan_by_key.h index 5bf48febda..c428c1050e 100644 --- a/thrust/system/detail/sequential/scan_by_key.h +++ b/thrust/system/detail/sequential/scan_by_key.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -146,5 +145,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/set_operations.h b/thrust/system/detail/sequential/set_operations.h index a9b1cc688c..678754b45d 100644 --- a/thrust/system/detail/sequential/set_operations.h +++ b/thrust/system/detail/sequential/set_operations.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -220,5 +219,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/sort.h b/thrust/system/detail/sequential/sort.h index 0900743d8d..34cc7a8ba8 100644 --- a/thrust/system/detail/sequential/sort.h +++ b/thrust/system/detail/sequential/sort.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -58,7 +57,7 @@ void stable_sort_by_key(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/sequential/sort.inl b/thrust/system/detail/sequential/sort.inl index bbc18a0b26..f7ebb5b375 100644 --- a/thrust/system/detail/sequential/sort.inl +++ b/thrust/system/detail/sequential/sort.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -200,5 +199,5 @@ void stable_sort_by_key(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/stable_merge_sort.h b/thrust/system/detail/sequential/stable_merge_sort.h index 359ba8d7b4..64aa2bf96c 100644 --- a/thrust/system/detail/sequential/stable_merge_sort.h +++ b/thrust/system/detail/sequential/stable_merge_sort.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -54,7 +53,7 @@ void stable_merge_sort_by_key(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/sequential/stable_merge_sort.inl b/thrust/system/detail/sequential/stable_merge_sort.inl index 2939e06686..ded55d0954 100644 --- a/thrust/system/detail/sequential/stable_merge_sort.inl +++ b/thrust/system/detail/sequential/stable_merge_sort.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -393,5 +392,5 @@ void stable_merge_sort_by_key(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/stable_primitive_sort.h b/thrust/system/detail/sequential/stable_primitive_sort.h index 3426f953a0..acbb81217b 100644 --- a/thrust/system/detail/sequential/stable_primitive_sort.h +++ b/thrust/system/detail/sequential/stable_primitive_sort.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -50,7 +49,7 @@ void stable_primitive_sort_by_key(sequential::execution_policy &e } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/sequential/stable_primitive_sort.inl b/thrust/system/detail/sequential/stable_primitive_sort.inl index e5cea4ad3b..9897d6798d 100644 --- a/thrust/system/detail/sequential/stable_primitive_sort.inl +++ b/thrust/system/detail/sequential/stable_primitive_sort.inl @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -157,5 +156,5 @@ void stable_primitive_sort_by_key(sequential::execution_policy &e } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/stable_radix_sort.h b/thrust/system/detail/sequential/stable_radix_sort.h index 9f7482ccf9..1e9713a2cc 100644 --- a/thrust/system/detail/sequential/stable_radix_sort.h +++ b/thrust/system/detail/sequential/stable_radix_sort.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -50,7 +49,7 @@ void stable_radix_sort_by_key(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/detail/sequential/stable_radix_sort.inl b/thrust/system/detail/sequential/stable_radix_sort.inl index 2bb8412420..c8a2bf3798 100644 --- a/thrust/system/detail/sequential/stable_radix_sort.inl +++ b/thrust/system/detail/sequential/stable_radix_sort.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -591,5 +590,5 @@ void stable_radix_sort_by_key(sequential::execution_policy &exec, } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/trivial_copy.h b/thrust/system/detail/sequential/trivial_copy.h index 8fbd0a987a..cefb189384 100644 --- a/thrust/system/detail/sequential/trivial_copy.h +++ b/thrust/system/detail/sequential/trivial_copy.h @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -58,5 +57,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/unique.h b/thrust/system/detail/sequential/unique.h index 11168f0b42..e4953e9aed 100644 --- a/thrust/system/detail/sequential/unique.h +++ b/thrust/system/detail/sequential/unique.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -93,5 +92,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/sequential/unique_by_key.h b/thrust/system/detail/sequential/unique_by_key.h index 899ce02db7..d30cc7c715 100644 --- a/thrust/system/detail/sequential/unique_by_key.h +++ b/thrust/system/detail/sequential/unique_by_key.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace detail @@ -112,5 +111,5 @@ __host__ __device__ } // end namespace sequential } // end namespace detail } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/detail/system_error.inl b/thrust/system/detail/system_error.inl index 3e59458aa0..07947cdd46 100644 --- a/thrust/system/detail/system_error.inl +++ b/thrust/system/detail/system_error.inl @@ -19,8 +19,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -107,5 +106,5 @@ const char *system_error } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/error_code.h b/thrust/system/error_code.h index faa81bbca3..d460a315b1 100644 --- a/thrust/system/error_code.h +++ b/thrust/system/error_code.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -515,7 +514,7 @@ namespace errc = system::errc; using system::generic_category; using system::system_category; -} // end thrust +THRUST_NAMESPACE_END #include #include diff --git a/thrust/system/omp/detail/adjacent_difference.h b/thrust/system/omp/detail/adjacent_difference.h index 7f314eaebb..622ee61baf 100644 --- a/thrust/system/omp/detail/adjacent_difference.h +++ b/thrust/system/omp/detail/adjacent_difference.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -46,5 +45,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -69,5 +68,5 @@ bool binary_search(execution_policy &exec, } // end detail } // end omp } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/copy.h b/thrust/system/omp/detail/copy.h index e2b6661e87..ae7b1eed77 100644 --- a/thrust/system/omp/detail/copy.h +++ b/thrust/system/omp/detail/copy.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -51,7 +50,7 @@ OutputIterator copy_n(execution_policy &exec, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/omp/detail/copy.inl b/thrust/system/omp/detail/copy.inl index 4d104e5ec6..47f606dda6 100644 --- a/thrust/system/omp/detail/copy.inl +++ b/thrust/system/omp/detail/copy.inl @@ -23,8 +23,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -133,5 +132,5 @@ OutputIterator copy_n(execution_policy &exec, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/copy_if.h b/thrust/system/omp/detail/copy_if.h index a5c28704d3..b33fd96df1 100644 --- a/thrust/system/omp/detail/copy_if.h +++ b/thrust/system/omp/detail/copy_if.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -45,7 +44,7 @@ template diff --git a/thrust/system/omp/detail/copy_if.inl b/thrust/system/omp/detail/copy_if.inl index 7f2516a749..8e597d4fcc 100644 --- a/thrust/system/omp/detail/copy_if.inl +++ b/thrust/system/omp/detail/copy_if.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -50,5 +49,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -39,7 +38,7 @@ thrust::system::detail::internal::uniform_decomposition default_decom } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/omp/detail/default_decomposition.inl b/thrust/system/omp/detail/default_decomposition.inl index 53f4b428f6..f63ddf1256 100644 --- a/thrust/system/omp/detail/default_decomposition.inl +++ b/thrust/system/omp/detail/default_decomposition.inl @@ -22,8 +22,7 @@ #include #endif // omp support -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -56,5 +55,5 @@ thrust::system::detail::internal::uniform_decomposition default_decom } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/execution_policy.h b/thrust/system/omp/detail/execution_policy.h index 52c879a168..f9b45312be 100644 --- a/thrust/system/omp/detail/execution_policy.h +++ b/thrust/system/omp/detail/execution_policy.h @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { // put the canonical tag in the same ns as the backend's entry points @@ -103,5 +102,5 @@ using thrust::system::omp::execution_policy; using thrust::system::omp::tag; } // end omp -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/extrema.h b/thrust/system/omp/detail/extrema.h index 96661180d3..bde4e5f80c 100644 --- a/thrust/system/omp/detail/extrema.h +++ b/thrust/system/omp/detail/extrema.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -62,6 +61,6 @@ thrust::pair minmax_element(execution_policy #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -47,5 +46,5 @@ InputIterator find_if(execution_policy &exec, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/for_each.h b/thrust/system/omp/detail/for_each.h index 4e6955ea2b..a2030f3746 100644 --- a/thrust/system/omp/detail/for_each.h +++ b/thrust/system/omp/detail/for_each.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -54,7 +53,7 @@ template diff --git a/thrust/system/omp/detail/for_each.inl b/thrust/system/omp/detail/for_each.inl index 6be6435e6c..cb51bd0e0a 100644 --- a/thrust/system/omp/detail/for_each.inl +++ b/thrust/system/omp/detail/for_each.inl @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -96,5 +95,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -80,5 +79,5 @@ inline void free(pointer ptr) } // end omp } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/par.h b/thrust/system/omp/detail/par.h index 1d38df2cf0..b81a5d4894 100644 --- a/thrust/system/omp/detail/par.h +++ b/thrust/system/omp/detail/par.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -58,5 +57,5 @@ using thrust::system::omp::par; } // end omp -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/partition.h b/thrust/system/omp/detail/partition.h index 64a76e2788..7a6f4a9344 100644 --- a/thrust/system/omp/detail/partition.h +++ b/thrust/system/omp/detail/partition.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -85,7 +84,7 @@ template diff --git a/thrust/system/omp/detail/partition.inl b/thrust/system/omp/detail/partition.inl index b81c17cbf4..ba0a09eafb 100644 --- a/thrust/system/omp/detail/partition.inl +++ b/thrust/system/omp/detail/partition.inl @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -104,5 +103,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -48,7 +47,7 @@ template diff --git a/thrust/system/omp/detail/reduce.inl b/thrust/system/omp/detail/reduce.inl index 4609922a94..e295be8920 100644 --- a/thrust/system/omp/detail/reduce.inl +++ b/thrust/system/omp/detail/reduce.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -68,5 +67,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -55,7 +54,7 @@ template diff --git a/thrust/system/omp/detail/reduce_by_key.inl b/thrust/system/omp/detail/reduce_by_key.inl index afd4c8e51f..a4e944b534 100644 --- a/thrust/system/omp/detail/reduce_by_key.inl +++ b/thrust/system/omp/detail/reduce_by_key.inl @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -53,5 +52,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -47,7 +46,7 @@ void reduce_intervals(execution_policy &exec, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/omp/detail/reduce_intervals.inl b/thrust/system/omp/detail/reduce_intervals.inl index 961f2757af..9b89af4f10 100644 --- a/thrust/system/omp/detail/reduce_intervals.inl +++ b/thrust/system/omp/detail/reduce_intervals.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -93,5 +92,5 @@ void reduce_intervals(execution_policy &, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/remove.h b/thrust/system/omp/detail/remove.h index ca4eab8457..9b2d46e75c 100644 --- a/thrust/system/omp/detail/remove.h +++ b/thrust/system/omp/detail/remove.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -75,7 +74,7 @@ template diff --git a/thrust/system/omp/detail/remove.inl b/thrust/system/omp/detail/remove.inl index aa82894762..5330f14072 100644 --- a/thrust/system/omp/detail/remove.inl +++ b/thrust/system/omp/detail/remove.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -90,5 +89,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -49,7 +48,7 @@ void stable_sort_by_key(execution_policy &exec, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/omp/detail/sort.inl b/thrust/system/omp/detail/sort.inl index 587017ca6c..4e37ee1ffd 100644 --- a/thrust/system/omp/detail/sort.inl +++ b/thrust/system/omp/detail/sort.inl @@ -30,8 +30,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -261,5 +260,5 @@ void stable_sort_by_key(execution_policy &exec, } // end namespace detail } // end namespace omp } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/detail/unique.h b/thrust/system/omp/detail/unique.h index 433e7689b6..304caf66d9 100644 --- a/thrust/system/omp/detail/unique.h +++ b/thrust/system/omp/detail/unique.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -53,7 +52,7 @@ template diff --git a/thrust/system/omp/detail/unique.inl b/thrust/system/omp/detail/unique.inl index 70f026dbb1..c03203efee 100644 --- a/thrust/system/omp/detail/unique.inl +++ b/thrust/system/omp/detail/unique.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -62,5 +61,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -61,7 +60,7 @@ template diff --git a/thrust/system/omp/detail/unique_by_key.inl b/thrust/system/omp/detail/unique_by_key.inl index 0a4367b7b2..6610c8a008 100644 --- a/thrust/system/omp/detail/unique_by_key.inl +++ b/thrust/system/omp/detail/unique_by_key.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -70,5 +69,5 @@ template #include -namespace thrust { namespace system { namespace omp +THRUST_NAMESPACE_BEGIN +namespace system { namespace omp { /*! Allocates an area of memory available to Thrust's omp system. @@ -94,7 +95,7 @@ using thrust::system::omp::allocator; using thrust::system::omp::universal_allocator; } // namespace omp -} // namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/omp/memory_resource.h b/thrust/system/omp/memory_resource.h index 7d74d7b9ed..7660113bee 100644 --- a/thrust/system/omp/memory_resource.h +++ b/thrust/system/omp/memory_resource.h @@ -26,7 +26,8 @@ #include -namespace thrust { namespace system { namespace omp +THRUST_NAMESPACE_BEGIN +namespace system { namespace omp { //! \cond @@ -63,5 +64,6 @@ typedef detail::native_resource universal_host_pinned_memory_resource; /*! \} */ -}}} // namespace thrust::system::omp +}} // namespace system::omp +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/pointer.h b/thrust/system/omp/pointer.h index d72069bd86..2be42e4fcf 100644 --- a/thrust/system/omp/pointer.h +++ b/thrust/system/omp/pointer.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace system { namespace omp +THRUST_NAMESPACE_BEGIN +namespace system { namespace omp { /*! \p omp::pointer stores a pointer to an object allocated in memory accessible @@ -112,5 +113,5 @@ using thrust::system::omp::universal_pointer; using thrust::system::omp::reference; } // namespace omp -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/omp/vector.h b/thrust/system/omp/vector.h index dead9f5921..179b5207dd 100644 --- a/thrust/system/omp/vector.h +++ b/thrust/system/omp/vector.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace system { namespace omp +THRUST_NAMESPACE_BEGIN +namespace system { namespace omp { /*! \p omp::vector is a container that supports random access to elements, @@ -78,4 +79,4 @@ using thrust::system::omp::vector; using thrust::system::omp::universal_vector; } -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/system_error.h b/thrust/system/system_error.h index 84e453dc66..cf6139330e 100644 --- a/thrust/system/system_error.h +++ b/thrust/system/system_error.h @@ -28,8 +28,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { @@ -173,7 +172,7 @@ class system_error // import names into thrust:: using system::system_error; -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/tbb/detail/adjacent_difference.h b/thrust/system/tbb/detail/adjacent_difference.h index d22b4aac34..ab519d11eb 100644 --- a/thrust/system/tbb/detail/adjacent_difference.h +++ b/thrust/system/tbb/detail/adjacent_difference.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -46,5 +45,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -51,7 +50,7 @@ OutputIterator copy_n(execution_policy &exec, } // end namespace detail } // end namespace tbb } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/tbb/detail/copy.inl b/thrust/system/tbb/detail/copy.inl index 0d96ad48b7..1016f40d4d 100644 --- a/thrust/system/tbb/detail/copy.inl +++ b/thrust/system/tbb/detail/copy.inl @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -133,5 +132,5 @@ OutputIterator copy_n(execution_policy &exec, } // end namespace detail } // end namespace tbb } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/detail/copy_if.h b/thrust/system/tbb/detail/copy_if.h index 0420893ba6..db860f3775 100644 --- a/thrust/system/tbb/detail/copy_if.h +++ b/thrust/system/tbb/detail/copy_if.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -44,7 +43,7 @@ template diff --git a/thrust/system/tbb/detail/copy_if.inl b/thrust/system/tbb/detail/copy_if.inl index 9c074a9fcd..aa2379b8d0 100644 --- a/thrust/system/tbb/detail/copy_if.inl +++ b/thrust/system/tbb/detail/copy_if.inl @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -127,5 +126,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { // put the canonical tag in the same ns as the backend's entry points @@ -79,5 +78,5 @@ using thrust::system::tbb::execution_policy; using thrust::system::tbb::tag; } // end tbb -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/detail/extrema.h b/thrust/system/tbb/detail/extrema.h index e0dd4c042b..c6c747f426 100644 --- a/thrust/system/tbb/detail/extrema.h +++ b/thrust/system/tbb/detail/extrema.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -62,6 +61,6 @@ thrust::pair minmax_element(execution_policy #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -42,5 +41,5 @@ InputIterator find_if(execution_policy &exec, } // end namespace detail } // end namespace tbb } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/detail/for_each.h b/thrust/system/tbb/detail/for_each.h index dfe5329b84..26c4b539b0 100644 --- a/thrust/system/tbb/detail/for_each.h +++ b/thrust/system/tbb/detail/for_each.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -48,7 +47,7 @@ template diff --git a/thrust/system/tbb/detail/for_each.inl b/thrust/system/tbb/detail/for_each.inl index 00e025ea0b..688b717230 100644 --- a/thrust/system/tbb/detail/for_each.inl +++ b/thrust/system/tbb/detail/for_each.inl @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -96,5 +95,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -82,5 +81,5 @@ inline void free(pointer ptr) } // end tbb } // end system -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/detail/merge.h b/thrust/system/tbb/detail/merge.h index 44608959ce..014e2eb8bc 100644 --- a/thrust/system/tbb/detail/merge.h +++ b/thrust/system/tbb/detail/merge.h @@ -19,8 +19,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -64,7 +63,7 @@ thrust::pair } // end detail } // end tbb } // end system -} // end thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/tbb/detail/merge.inl b/thrust/system/tbb/detail/merge.inl index a85bee163a..c2f2ef91c8 100644 --- a/thrust/system/tbb/detail/merge.inl +++ b/thrust/system/tbb/detail/merge.inl @@ -22,8 +22,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -282,5 +281,5 @@ thrust::pair } // end namespace detail } // end namespace tbb } // end namespace system -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/detail/par.h b/thrust/system/tbb/detail/par.h index daabb537eb..308d41e136 100644 --- a/thrust/system/tbb/detail/par.h +++ b/thrust/system/tbb/detail/par.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -58,5 +57,5 @@ using thrust::system::tbb::par; } // end tbb -} // end thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/detail/partition.h b/thrust/system/tbb/detail/partition.h index 80323535c9..f9c56b92b5 100644 --- a/thrust/system/tbb/detail/partition.h +++ b/thrust/system/tbb/detail/partition.h @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -81,7 +80,7 @@ template diff --git a/thrust/system/tbb/detail/partition.inl b/thrust/system/tbb/detail/partition.inl index 5085ed906b..74ad809da4 100644 --- a/thrust/system/tbb/detail/partition.inl +++ b/thrust/system/tbb/detail/partition.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -98,5 +97,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -48,7 +47,7 @@ template diff --git a/thrust/system/tbb/detail/reduce.inl b/thrust/system/tbb/detail/reduce.inl index bef54f5e29..47fe6616d6 100644 --- a/thrust/system/tbb/detail/reduce.inl +++ b/thrust/system/tbb/detail/reduce.inl @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -127,5 +126,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -51,7 +50,7 @@ template diff --git a/thrust/system/tbb/detail/reduce_by_key.inl b/thrust/system/tbb/detail/reduce_by_key.inl index 70933f3070..55a94a9b9a 100644 --- a/thrust/system/tbb/detail/reduce_by_key.inl +++ b/thrust/system/tbb/detail/reduce_by_key.inl @@ -32,8 +32,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -338,5 +337,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -121,5 +120,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace omp @@ -75,7 +74,7 @@ template diff --git a/thrust/system/tbb/detail/remove.inl b/thrust/system/tbb/detail/remove.inl index 0a937799d2..76d77e64ba 100644 --- a/thrust/system/tbb/detail/remove.inl +++ b/thrust/system/tbb/detail/remove.inl @@ -20,8 +20,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -90,5 +89,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -58,7 +57,7 @@ template diff --git a/thrust/system/tbb/detail/scan.inl b/thrust/system/tbb/detail/scan.inl index 613b028722..d6e8949839 100644 --- a/thrust/system/tbb/detail/scan.inl +++ b/thrust/system/tbb/detail/scan.inl @@ -28,8 +28,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -256,4 +255,4 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -49,7 +48,7 @@ template diff --git a/thrust/system/tbb/detail/sort.inl b/thrust/system/tbb/detail/sort.inl index 907fa20892..070fb82256 100644 --- a/thrust/system/tbb/detail/sort.inl +++ b/thrust/system/tbb/detail/sort.inl @@ -24,8 +24,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -261,5 +260,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -53,7 +52,7 @@ template diff --git a/thrust/system/tbb/detail/unique.inl b/thrust/system/tbb/detail/unique.inl index 4ee3c0d9a2..0c3c16f2e8 100644 --- a/thrust/system/tbb/detail/unique.inl +++ b/thrust/system/tbb/detail/unique.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -62,5 +61,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -61,7 +60,7 @@ template diff --git a/thrust/system/tbb/detail/unique_by_key.inl b/thrust/system/tbb/detail/unique_by_key.inl index 9c1a150e1b..dbd5922b07 100644 --- a/thrust/system/tbb/detail/unique_by_key.inl +++ b/thrust/system/tbb/detail/unique_by_key.inl @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -70,5 +69,5 @@ template #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace system { namespace tbb @@ -98,7 +97,7 @@ using thrust::system::tbb::allocator; using thrust::system::tbb::universal_allocator; } // namsespace tbb -} // namespace thrust +THRUST_NAMESPACE_END #include diff --git a/thrust/system/tbb/memory_resource.h b/thrust/system/tbb/memory_resource.h index 4e534407c9..e4b98c239b 100644 --- a/thrust/system/tbb/memory_resource.h +++ b/thrust/system/tbb/memory_resource.h @@ -26,7 +26,8 @@ #include -namespace thrust { namespace system { namespace tbb +THRUST_NAMESPACE_BEGIN +namespace system { namespace tbb { //! \cond @@ -63,5 +64,6 @@ typedef detail::native_resource universal_host_pinned_memory_resource; /*! \} */ -}}} // namespace thrust::system::tbb +}} // namespace system::tbb +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/pointer.h b/thrust/system/tbb/pointer.h index ad01f44a72..065e1a548f 100644 --- a/thrust/system/tbb/pointer.h +++ b/thrust/system/tbb/pointer.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace system { namespace tbb +THRUST_NAMESPACE_BEGIN +namespace system { namespace tbb { /*! \p tbb::pointer stores a pointer to an object allocated in memory accessible @@ -112,5 +113,5 @@ using thrust::system::tbb::universal_pointer; using thrust::system::tbb::reference; } // namespace tbb -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system/tbb/vector.h b/thrust/system/tbb/vector.h index e5d148416c..8cbbabbd24 100644 --- a/thrust/system/tbb/vector.h +++ b/thrust/system/tbb/vector.h @@ -26,7 +26,8 @@ #include #include -namespace thrust { namespace system { namespace tbb +THRUST_NAMESPACE_BEGIN +namespace system { namespace tbb { /*! \p tbb::vector is a container that supports random access to elements, @@ -78,4 +79,4 @@ using thrust::system::tbb::vector; using thrust::system::tbb::universal_vector; } -} // namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/system_error.h b/thrust/system_error.h index 7119ac4b63..674ec3da9e 100644 --- a/thrust/system_error.h +++ b/thrust/system_error.h @@ -22,8 +22,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup system * \{ @@ -44,8 +43,7 @@ namespace system /*! \} // end system */ -} // end thrust +THRUST_NAMESPACE_END #include #include - diff --git a/thrust/tabulate.h b/thrust/tabulate.h index 1ed7144558..7cb7945508 100644 --- a/thrust/tabulate.h +++ b/thrust/tabulate.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup transformations * \{ @@ -122,8 +120,6 @@ template /*! \} // end transformations */ - -} // end namespace thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/transform.h b/thrust/transform.h index b78b38579c..2d064c13b3 100644 --- a/thrust/transform.h +++ b/thrust/transform.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -718,8 +716,6 @@ template - diff --git a/thrust/transform_reduce.h b/thrust/transform_reduce.h index 488ead6b6e..11d6b84c3e 100644 --- a/thrust/transform_reduce.h +++ b/thrust/transform_reduce.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup reductions * \{ @@ -191,8 +189,6 @@ template - diff --git a/thrust/transform_scan.h b/thrust/transform_scan.h index faa6a7791d..6c0fe81166 100644 --- a/thrust/transform_scan.h +++ b/thrust/transform_scan.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup algorithms */ @@ -317,8 +315,6 @@ template - diff --git a/thrust/tuple.h b/thrust/tuple.h index 45df2be6ea..69b709fabb 100644 --- a/thrust/tuple.h +++ b/thrust/tuple.h @@ -34,8 +34,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup utility * \{ @@ -581,5 +580,4 @@ bool operator>(const null_type&, const null_type&); /*! \} // utility */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/type_traits/integer_sequence.h b/thrust/type_traits/integer_sequence.h index dda3db3422..77d6fa500c 100644 --- a/thrust/type_traits/integer_sequence.h +++ b/thrust/type_traits/integer_sequence.h @@ -23,8 +23,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN #if THRUST_CPP_DIALECT >= 2014 @@ -256,7 +255,7 @@ struct integer_sequence_push_back_impl > } // namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/type_traits/is_contiguous_iterator.h b/thrust/type_traits/is_contiguous_iterator.h index 3e075bd28b..ebd2845b6f 100644 --- a/thrust/type_traits/is_contiguous_iterator.h +++ b/thrust/type_traits/is_contiguous_iterator.h @@ -38,8 +38,7 @@ #endif #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -85,10 +84,11 @@ struct proclaim_contiguous_iterator : false_type {}; /// ContiguousIterator /// by specializing `thrust::proclaim_contiguous_iterator`. #define THRUST_PROCLAIM_CONTIGUOUS_ITERATOR(Iterator) \ - namespace thrust { \ + THRUST_NAMESPACE_BEGIN \ template <> \ - struct proclaim_contiguous_iterator : ::thrust::true_type {}; \ - } /* end namespace thrust */ \ + struct proclaim_contiguous_iterator \ + : THRUST_NS_QUALIFIER::true_type {}; \ + THRUST_NAMESPACE_END \ /**/ /////////////////////////////////////////////////////////////////////////////// @@ -181,5 +181,5 @@ struct is_contiguous_iterator_impl } // namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/type_traits/is_execution_policy.h b/thrust/type_traits/is_execution_policy.h index 3f2f7ef80a..cab434b0cf 100644 --- a/thrust/type_traits/is_execution_policy.h +++ b/thrust/type_traits/is_execution_policy.h @@ -21,8 +21,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /// Unary metafunction that is \c true if \c T is an \a ExecutionPolicy and /// \c false otherwise. @@ -45,6 +44,6 @@ template constexpr bool is_execution_policy_v = is_execution_policy::value; #endif -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/type_traits/is_operator_less_or_greater_function_object.h b/thrust/type_traits/is_operator_less_or_greater_function_object.h index 6efc002238..58c795de52 100644 --- a/thrust/type_traits/is_operator_less_or_greater_function_object.h +++ b/thrust/type_traits/is_operator_less_or_greater_function_object.h @@ -27,8 +27,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -132,5 +131,5 @@ struct is_operator_greater_function_object_impl > : true_type } // namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/type_traits/is_operator_plus_function_object.h b/thrust/type_traits/is_operator_plus_function_object.h index 0b2ebb1074..1af764ddff 100644 --- a/thrust/type_traits/is_operator_plus_function_object.h +++ b/thrust/type_traits/is_operator_plus_function_object.h @@ -26,8 +26,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -73,5 +72,5 @@ struct is_operator_plus_function_object_impl > : true_type {}; } // namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/type_traits/is_trivially_relocatable.h b/thrust/type_traits/is_trivially_relocatable.h index de38735d29..14fae0f7d4 100644 --- a/thrust/type_traits/is_trivially_relocatable.h +++ b/thrust/type_traits/is_trivially_relocatable.h @@ -22,8 +22,7 @@ #include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN namespace detail { @@ -124,10 +123,11 @@ struct proclaim_trivially_relocatable : false_type {}; /// Declares that the type \c T is \a TriviallyRelocatable by specializing /// `thrust::proclaim_trivially_relocatable`. #define THRUST_PROCLAIM_TRIVIALLY_RELOCATABLE(T) \ - namespace thrust { \ + THRUST_NAMESPACE_BEGIN \ template <> \ - struct proclaim_trivially_relocatable : ::thrust::true_type {}; \ - } /* end namespace thrust */ \ + struct proclaim_trivially_relocatable : THRUST_NS_QUALIFIER::true_type \ + {}; \ + THRUST_NAMESPACE_END \ /**/ /////////////////////////////////////////////////////////////////////////////// @@ -186,7 +186,7 @@ struct is_trivially_relocatable_impl : is_trivially_relocatable_impl {} } // namespace detail -} // end namespace thrust +THRUST_NAMESPACE_END #if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA diff --git a/thrust/type_traits/logical_metafunctions.h b/thrust/type_traits/logical_metafunctions.h index 5f86ee6a82..97297e93cc 100644 --- a/thrust/type_traits/logical_metafunctions.h +++ b/thrust/type_traits/logical_metafunctions.h @@ -19,8 +19,7 @@ #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN #if THRUST_CPP_DIALECT >= 2017 @@ -173,7 +172,7 @@ constexpr bool negation_value_v = negation_value::value; template struct negation_value : std::integral_constant {}; -} // end namespace thrust +THRUST_NAMESPACE_END #endif // THRUST_CPP_DIALECT >= 2011 diff --git a/thrust/type_traits/remove_cvref.h b/thrust/type_traits/remove_cvref.h index 0fb7fc32a9..825cc6ff18 100644 --- a/thrust/type_traits/remove_cvref.h +++ b/thrust/type_traits/remove_cvref.h @@ -25,8 +25,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN #if defined(__cpp_lib_remove_cvref) && (__cpp_lib_remove_cvref >= 201711L) @@ -50,5 +49,5 @@ using remove_cvref_t = typename remove_cvref::type; #endif // THRUST_CPP_DIALECT >= 2020 -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/type_traits/void_t.h b/thrust/type_traits/void_t.h index 8ab56a3e87..df9b0965cc 100644 --- a/thrust/type_traits/void_t.h +++ b/thrust/type_traits/void_t.h @@ -26,8 +26,7 @@ # include #endif -namespace thrust -{ +THRUST_NAMESPACE_BEGIN #if THRUST_CPP_DIALECT >= 2011 @@ -60,5 +59,5 @@ struct voider #endif -} // end namespace thrust +THRUST_NAMESPACE_END diff --git a/thrust/uninitialized_copy.h b/thrust/uninitialized_copy.h index 1214f5fb5d..94c2763e3e 100644 --- a/thrust/uninitialized_copy.h +++ b/thrust/uninitialized_copy.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup copying * \{ @@ -296,8 +294,6 @@ template /*! \} // copying */ - -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/uninitialized_fill.h b/thrust/uninitialized_fill.h index d11d9f3e31..b46758a3c8 100644 --- a/thrust/uninitialized_fill.h +++ b/thrust/uninitialized_fill.h @@ -24,9 +24,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup filling * \ingroup transformations @@ -269,7 +267,6 @@ template * \} // transformations */ -} // end thrust +THRUST_NAMESPACE_END #include - diff --git a/thrust/unique.h b/thrust/unique.h index 1782a5c92b..426b37ab73 100644 --- a/thrust/unique.h +++ b/thrust/unique.h @@ -25,9 +25,7 @@ #include #include -namespace thrust -{ - +THRUST_NAMESPACE_BEGIN /*! \addtogroup stream_compaction * \{ @@ -961,8 +959,7 @@ template diff --git a/thrust/universal_allocator.h b/thrust/universal_allocator.h index dcd08d8d40..8d85cd20de 100644 --- a/thrust/universal_allocator.h +++ b/thrust/universal_allocator.h @@ -29,8 +29,7 @@ #include __THRUST_DEVICE_SYSTEM_MEMORY_HEADER #undef __THRUST_DEVICE_SYSTEM_MEMORY_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /** \addtogroup memory_resources Memory Resources * \ingroup memory_management_classes @@ -75,5 +74,4 @@ using universal_ptr = /*! \} */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/universal_vector.h b/thrust/universal_vector.h index 485f4815bb..444187f8cf 100644 --- a/thrust/universal_vector.h +++ b/thrust/universal_vector.h @@ -30,8 +30,7 @@ #include __THRUST_DEVICE_SYSTEM_VECTOR_HEADER #undef __THRUST_DEVICE_SYSTEM_VECTOR_HEADER -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /** \addtogroup memory_resources Memory Resources * \ingroup memory_management_classes @@ -55,5 +54,4 @@ using thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::universal_vector; /*! \} */ -} // end thrust - +THRUST_NAMESPACE_END diff --git a/thrust/version.h b/thrust/version.h index ec7208edd1..e2591cda3c 100644 --- a/thrust/version.h +++ b/thrust/version.h @@ -73,12 +73,3 @@ * Legacy; will be 0 for all future releases. */ #define THRUST_PATCH_NUMBER 0 - -/*! \namespace thrust - * \brief \p thrust is the top-level namespace which contains all Thrust - * functions and types. - */ -namespace thrust -{ - -} diff --git a/thrust/zip_function.h b/thrust/zip_function.h index faea59d4c5..b28e3babd8 100644 --- a/thrust/zip_function.h +++ b/thrust/zip_function.h @@ -17,8 +17,7 @@ #include #include -namespace thrust -{ +THRUST_NAMESPACE_BEGIN /*! \addtogroup function_objects Function Objects * \{ @@ -206,6 +205,6 @@ auto make_zip_function(Function&& fun) -> zip_function